#@L}5 _$% l0$)$$Hȱ$ UhL" `e$$%`$%`  R@W!( L(1   Y I`  d  Ld M * @  $ % CC$$)%1 Udߥ$9%: !0 S$% DD˙`  }J)Lr d M * @  $ % CC$$)%1 Udߥ$9%: !0 S$%} DD˙`  }J)Lr J  ((  p L ()   J}L= ( L 0q A    IB JC;? D W } LL  ` W )LA!  ߰")-݆ p" } $G@LL 08`Q")<2Q0 -G$Ș݆ UL# ; p8(()(0ʥ)NQ` }$GȘ݆LU )L ݆ L GȘ ݆LL )W>Z   HH)H }p h  hyhy D L> L JJ    ! LA*` BF }7'8  M HN H` 8 Z  \LdJJ!"! GFE@F (!L }EE !E^ ^ E E7EȩEdE/EȩE  D } .L }  ;F d  ;?F7F? ( .   Z D LL d } . D  L    p  E` , d)  D L) 0BM݊L݉} ML  N݆ L NLML [ TEqEHȱEqEh 0Gȹ G} HLL GɛL  LFREE SECTORS G) *Gȩ GȽG GȌ*jj >G} C8jJ3j2CD( C202C ԠBX` N 1? l LlD:RAMDISK}.COMLu L1 L ;LHL  T`  `1  ɐ     `TU  } L ? .  t`GBJ ~DEHI B V0dV!}QDEHI VF9 ,0 ,0 s0hhL  L` H hDHEh"}DEL8HI4 0 HI,0 0  9 .G VLO#},0 L4*IJ`llD1:AUTORUN.SYSNEED MEM.SAV TO LOAD THIS FILE.D1:MEM.SAV J y08 B|DEHI$} V0 0`B;DEL`?<0LV`@ʆ v s? F0Ξ05: [ BDEHI%} VY8 B V  @  /DE `E:D1:DUP.SYSERROR-SAVING USER MEMORY ON DISKTYPE Y TO &}STILL RUN DOS B;DE J  (` 9 V⪍ ઍ  -'}LLu ÝDEHILV 9 .l 9 .l  `` s$B BH(}I|DE V BLV nB,DE JLV B V BLVDEIʩ BꭝLu j} 3E:}DISK OPERATING SYSTEM II VERSION COPYRIGHT 1984 ATARI CORP.A. DISK DIRECTORY I. FORMAT DISKB. RUN CARTRIDG*}E J. DUPLICATE DISKC. COPY FILE K. BINARY SAVED. DELETE FILE(S) L. BINARY LOADE. RENAME FILE M. RUN AT ADDRES+}SF. LOCK FILE N. CREATE MEM.SAVG. UNLOCK FILE O. DUPLICATE FILEH. WRITE DOS FILES P. FORMAT SINGLEL !N',}#"&))9(&*)/h)''-&؆莟R'S  vL/ˢ L }Insert DOS 2.0s, type Y Λx -}DEfHI 1莏#q! @ y0ɛ8A0,' ȅ 1 1ild! 1L!NO SUCH ITEMSELECT.} ITEM OR FOR MENU! 0 .z:*{}.|{ 1 0 0JB 18L%|DL/}%DIRECTORY--SEARCH SPEC,LIST FILE?[# 0 0 &|D3" 1L!NOT A DISK FILEN !B 1L!E# 1 !BD0}ED:}:1BJ|DE 1DEBHI 1 h0ߢ 0.1}  0?詛 1 y0YЛ 1 ;#L" ;#L! BL1TYPE "Y" TO DELETE...DELETE FILE SPEC2}COPY--FROM, TO?OPTION NOT ALLOWED 074 FREE SECTORS COPYING---D2:SHOWDOWN.GMSl# 0|D .L/%#3}##JB|DE 1BHID#E 1#0: B 1L!#͑### B 1#c$0SY4}S1}:## # # .#Ƚ# # 𩛙## 1,#PD#ELJ- <.BJD#E 5}1 1HH 0hh|DL%1}:̳# L% #D#EL% 1 0 . .0O% 1L!WILD CARDS NOT A6}LLOWED IN DESTINATION 0 <.|K}N 2 FORMAT. t* 5) 1L!`) 0NΞ 0 L1) 1 L!BAD LOAD FILELOAD FROM WHAT FILE?) 0 ?}0#B 1L!WHAT FILE TO LOCK?) 0 0$B 1L!WHAT FILE TO UNLOCK?DUP DISK-SOURCE,DEST DRIVES?TYPE "Y" IF OK TO US@}E PROGRAM AREACAUTION: A "Y" INVALIDATES MEM.SAV.FE! +L1   `*  70 2 2A} 0.* 1 y0 0)INSERT BOTH DISKS, TYPE RETURN^, 1 y038逍 N, 1L! ,B}C, t*  Lx+, 0 ^, 1 y0 , ,0,0 ,L+ ,I0 ,Vǭ0C}Ξ, 0 }, 1 y0C,ШC, 0K'!" H H 'h h Lx+!EF 5L1L!D,I,HhD}` NOT ENOUGH ROOMINSERT SOURCE DISK,TYPE RETURNINSERT DESTINATION DISK,TYPE RETURNE}`  `8 rL1`-* 1P* 1 y0Y`hhL!NAME OF FILE TO MOVE?- 0 0|DL% <.F},^ 1 70 0 .@L# .BJ 1  DEHIB V L1 ,} 1 70,L.  G}JB|,#P#DE 1 HI BDEHHII 1 B 1 ,^ 1 70,0La- B V,#PH},^ 1 70 0L#L!-* 1P* 1 y0Yj383}mm ݭI}}`8}``|* ? ɛ,`|:-)| / 1L!`DESTINATION CANT BE DOJ}S.SYS0 0H{ 24Δ 28/L!/) 2 Π 2 0 ξK}hAΞB,0 J 1 BDEHI,HÝDE 1HIHIDELSAVE-GIVE L}FILE,START,END(,INIT,RUN)O S0 1`BDEPHI V` S0H 1 L!M}0 0 1L~0`PLEASE TYPE 1 LETTER,0`hhL! 70 1L0L<1 ,;ɛ7,"ɛ:ݦ1ݥN}A"D|ݤD|ȩ:|ȩ|ɛ,,(/+.ީ1 1,ɛ`轤{NAMEO} TOO LONG B VL!` L1I H1EΝDL1|mDiE` V0`8d/8 i:222 1 LP}!ERROR- 162ɛ+,' 20*.. өr2 1``2TOO MANY DIGITSINVALID HEXAQ}DECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8uR} ECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8uM D D D D %BB! % 9* v% w%u % D %LJ& fffffff>`<T}|0`̌8l8pv00````00 0f< x||||W}|||~|l8l8lfff< 0`@`0 000006c!"|™X}|™|~x|™|as22sa>2222r|晒xLLLLNB|晁晉|™||™Y}v|~Þ~fdddd||晙d8晙™晙dd|2x`x`~<~~<"#30 ~ <~~<Z}|~~||~~||>````~~8<8<||[}~~~|0000~l8|ll8l~ 8`8pp##8\}$ %0$1$3$4$ ?̏?1$4$ॄ``ex$w$e{$z$褄 x${]}$`(mDeXYi????)^̜D)DȄ?Čei?̜D@L$^}i( %&L$??`??????8??Ƌ拑` T8` 8` n%D_} %LJ&} T8t?????@:@CD(DDi?18?8?8?@K????` -??`} $ &= Y%&'?L' &= Y%?`'XRUT`H)h)` i@LG&8 `DCIDID $ 8a}Х)LS&ЭC?H &hɛL&,C0ɜf) `{\\X^T_PHC^? e,h .&) Cb} $8??''i?i? 'LJ&?'?'LJ&ʊ &HIHd'Hc'H`# \^_|}~2k)c}9:+O)29+,0];'3A/1/s)l32'))(m(( ):--,+<,+4,++d,CIC`"I"` (8??8??? ??d} $8?内?凅((?m???i? $L'`8???? ????8?? ??`8??e}`??`ЭD(DDΝD $ '} T8L &L'ЭDΜDΜDD $ '} T8L &ƇƆL'f}Ƌ^^()`8eiL'^` 懥͒?^eiL'??L'g}??8̓??? $LC)s)s)`)))))`Ƌ ^`^Ƌ͂?L)ƌ h}L(L)??L')*^懥͒?LC)懥͒?LC)^L4)?????i}`8??hh``8Ie?Ie?????8?m?͉? &۠= Y%?`???m?j}??m?? $????8?傅*+?僅 $8??????` K* ( h*8????` n( K* ( h*L+k}L. 9*2 &= Y% o%H &h)_ @W K* (Lh*S K* )Lh*P K* ;-Lh*`8????ХL'??l}L+͒???L++,L+ee8?傅?僅8傍?働? $8??????`m} @LO, @ O,L4) @ {, @` @ @ {,L'?m @?m @ͅ?hhL,m @m @8?倅?偅n} M$?m @??m @?`?It?`= Y% 8)})Y`,-Э`2 & > Y% ,L & % %LJ&^懥͒?o}LC)L4)Ƌ^Ƌ̓?L)8ee8内包LM-L'@ԩ-0p}1-XYȑȑ`ppp-.A-Hs) ԍЍ)Х  h@Эq} 9* &> Y%I $I2 o%)_ @W . )L.S . )L.P . -L. 'L &??`8??r}?? *?? $L5.'U?? T8~ T8? o%?,C09 .n/CL.ɛE~L.~ T8L.) }̓?𻥌)s}Ю ? T8CL.?`2 &Ϡ= Y% ,L &D D D D Lto/j0CL|/C??L/Ct}8?勪,C0ɛ^L/ .&L/^L/ 2` &9> Y% [00@ w/p?D?E8??H??I B V0 ou}/ ';0 LX1H o/h!H} T8Q> Y%h v8 P0 -?` &Y> Y%L70C BLVpCCH@k0f1 .h? &hhL- P0Cv}D?E?HICJBLV8??ą &s> Y% [0L0 % 0L0LX1CDE8?冝Hw}?凝IB V`CHm??Im???e??e? /??` P0L0} T8ig1b2> Y%L70@ԭs)x})`????8* &?.??.??.??.? ??L1? ?8??????L1?`8????y}?? ? &> Y%?`m?m?8?倅?偅eͅ? &> Y%?` M$?m???c2^3m??z}?? $L'ȱȊ`)?! ;I@Ln(H)h)` @@L2i `Э& &? Y% .@L &?@̔?{}L &@@S@ .&ъ 拥͒?6@ei?Ō?卐8@@@ '` _3Z4& ? Y%|}?` &8???? v8?`KE:P@HH8@@@@1pHI B@ V( 0LJ&hh@`}} &נ>LY%L5ЭL= &> Y% o1 [0L5 o1 3?? @ @C3? @@3t@??[4V5@~}@?@L5^)@@@?挐?@?ȱ?8ei@ 5@ 58.@??䅎@ 7 5@}? 258??<:? ?? 25?E T8> Y% o% '; -} T8 &LJ&LX48?@0 5??兎B W5}R65 7 5 5 5@@?8@@@@ &> Y% o% 3??䅎A 5 7?@0 5` ?@ 3`?m@}@ 5` 3C 3` @) 25656 @L.7ʊ @6HHG6HF6H`8@eiLX4^@`wlrtbsnhf%p?xmqi6666}66S6N766766x6n6e6'7P7ȩ@L*6 1@L*6 1@?@L*6 1@?@L*6 1?L*6?L*6 1?L*6 1?L*6 1?L}*6 1?L*6 1?L*6@ȘH 25h@` 7?A?L*6ȱ^` 7?B?L*6 7L*6ȱ @Ls4 1H @)}hd@ *6LO7-86^ 2???`CC 0L3 % 0L3hhpCLN4̏?0 2 3 @  3_ 3L}7`@) @ 2c8@?J8? 3@L7e8??8? L7u @I @#@@@ q8@L7 @d@ 3L7.8)9 B V}nD8EHIBLV䌡8HI B V䬡8`E:Lx8Dԅ ؠH),D0 T8L8 3h0``}D 8D)?<D)@`I@`D9,P a{)ɀ`H2ҢҠh`lj;k+*opui-=vc*99bx}z436521, .nm/reytwq907~8<>fhdgsaLJ:K\^OPUI_|VCBXZ$#&%"![ ]NM?REYTWQ()'@}FHDGSA {  } ` }9: 2@ : 2@ &: $L9L &Э# &? Y% .:@?<@̔?}L &8@@e@@ee8?傅?僅 $8?@???:@) @ @ {,<@ .&:@m:@i}L':; ';pD>EHIJB V0\DDdDeDDD L;0?+K T8 L;03D L;0) T8DD. T8L: } L;ƌL:p B VpC`H T8h T8 L;0 T8LA;pHIBLV o1 .8 o1R} T8 : =DDDΘDΘD = o%};a;<)_ݼ;L<ʊ ;H;H`+*-=RLUF12345678 ;<<0<<<<<=========G=%= =DL< =DD} DDDL; =D8L< =Di͘DުL<>C) 2 C C.ʎDC`pBDHID}CELV CL^;pCJ C< w<0% % 00} T8 - &LJ&T T8LT8@ '; Y=Q> Y%@ v8 T8}> Y% o% =L< I==` Y=? Y%>LT8=>`Page 6 Writer by Phil CardwellExit to DOSBuffer FullDelete (S,W,P):} Are You Sure? (Y/N)ERASE ALL TEXTErase (S,W,P): to exitSave (Device:Filename)>Error #BREAK Key AbortNo ErrorsL}oad (Device:Filename)> Press D1:*.*Memory Ful>?lNo text in bufferPrint (Device:Filename)>Printing...Insert nex}t sheet, press Find:Not FoundChange To: -Exit ̭oad ̭elete ormat nlock ock ename Drive #}Rename to:Format Diskrive #wEDITING FUNCTIONSCONTROL + = MOVES CURSOR 1 SPACE LEFTCONTROL * = MOVES CURSOR 1 SPACE RIGHTCONTROL - = MOVES CURSOR TO B }EGINNING OF PREVIOUS SENTENCECONTROL = = MOVES CURSOR TO BEGINNING OF NEXT SENTENCESHIFT + = MOVES CURSOR TO BEGINNING OF P }REVIOUS WORDSHIFT * = MOVES CURSOR TO BEGINNING OF NEXT WORDSHIFT - = MOVES CURSOR TO BEGINNING OF PREVIOUS PARAGRAPHSHIFT } = = MOVES CURSOR TO BEGINNING OF NEXT PARAGRAPHCONTROL INSERT= INSERT SINGLE SPACESHIFT INSERT= INSERT 255 SPACESCONTROL }DELETE= TAKES OUT LETTERSHIFT DELETE= TAKES OUT LINECONTROL H = CURSOR TO START POSITIONCONTROL E = CURSOR TO BOTTOM LEFT }CONTROL D = ERASES A BLOCK OF TEXT EG:- EITHER WORD, SENTENCE OR PARAGRAPH UP TO THE PREVIOUS SENTENCE.OPTION CONTROL D = WO }RKS IN REVERSE AS CONTROL D DOESWHEN USING CONTROL D, THE TEXT YOU HAVE DELETED IS NOT LOST. IT IS MOVED TO WHAT IS KNOWN AS } THE DELETE BUFFER. THIS PREVENTS YOU FROM ERASING TOO MUCH TEXT AND THEN HAVING TO RETYPE IT ALL. BY PRESSING CONTROL R THE } CONTENTS OF THE DELETE BUFFER WILL BE INSERTED AT THE CURRENT CURSOR POSITION. THE CONTROL R FUNCTION CAN BE USED UNTIL THE }MEMORY FULL APPEARS AND CAN BE USED AS A VERY SIMPLE CUT AND PASTE FACILITY TO CREATE DATA TABLES ETC.CONTROL D = ERASES DEL }ETE MEMORY BUFFERCONTROL I = CONTROLS INSERT/TYPEOVER TOGGLE AND DEFAULTS TO INSERT MODE WHEN FIRST RUNSHIFT CLEAR = ERASES } ALL TEXTDISK USAGECONTROL S = SAVES FILECONTROL L = LOADS FILEDOS FACILITIESCONTROL M = DOS MENUESCAPE = EXIT MENU } AND RETURN TO DOCUMENTCONTROL L = LOADS HIGHLIGHTED FILES INTO WORD PROCESSORCONTROL D = DELETES HIGHLIGHTED FILE NAMEF = } FORMATS DISK IN DEFAULT DRIVEL = LOCKS FILEU = UNLOCKS FILER = RENAMES FILE1-8 = GETS DISK DIRECTORYEXTRA FEATURESOP }TION CONTROL F = FIND PROMPTOPTION CONTROL C = CHANGE TO PROMPTCONTROL G = GLOBAL FUNCTION SEARCHES FOR A WORD AND WHEN FOU }ND IT WILL CHANGE ALL WORDS OF THAT TYPE.CONTROL B = CHANGES SCREEN COLORCONTROL T = CHANGES TEXT COLORCONTROL A = CHANGES } FROM UPPER CASE TO LOWER CASE OR VISA VERSACONTROL X = CHANGES CHARACTER ON THE RIGHT OF THE CURSOR WITH THE CURRENT CURSOR } CHARACTER.CONTROL W = AMOUNT OF FREE MEMORYCONTROL Z = DISTINGUISHES BETWEEN TRUE SPACES AND PADDED SPACES.EG:-TRUE SPACE }=SPACE BETWEEN WORDSPADDED SPACE =END OF LINE SPACEPRINTINGCONTROL P = PRINTER OPERATION, TYPE P:THEN PRESS RETURNCON }TROL COMMANDSREMEMBER TO HOLD DOWN THE SELECT KEY BEFORE PRESSING ANY OF THESE KEYSTHE SMALL L= USED TO SET THE LEFT MARGI }N, ANY VALUE BETWEEN 0 AND 255.ZERO REPRESENTS NO MARGIN. THE NORMAL MARGIN IS 5THE SMALL R=RIGHT MARGIN.VALUE=1 TO 255NOR }MAL VALUE IS 75.THE SMALL T=TOP MARGIN MEANS HOW MANY BLANK LINES AT THE TOP BEFORE PRINTINGDEFAULT IS 5.SMALL B=BOTTOM MA }RGIN.AS T. DEFAULT 58SMALL F=DEFINE FOOTER FOLLOWED BY A LINE OF UPTO 255 CHARACTERSSMALL H=DEFINE HEADER.IF HEADER NOT REQ }UIRED PRESS RETURN.SMALL I=INCLUDE A FILE. IF FOLLOWED BY A LEGAL FILE NAME(D:FILENAME.EXT),PAGE 6 WRITER WILL LOAD THE NEW }DOCUMENT AND CONTINUE PRINTING AS NORMAL. THIS ALLOWS DOCUMENTS LARGER THAN MEMORY CAPABILITIES TO BE PRINTED. m=MARGIN RELEA }SE USED TO OUT DENT TEXT,IT SHOULD COME INTO OPERATION BEFORE A LINE IS TO BE PRINTED, AND AFTER PRINTING THE NORMAL LEFT MAR }GIN VALUE IS RESTORED.SMALL N = NEXT PAGE, NO VALUE IS NEEDED TO FOLLOW THIS COMMANDSMALL P = PAGE LENGTH COUNTER, DEFAULTS } TO 69 THOUGH THIS MAY HAVE TO BE ALTERED DEPENDING ON YOUR PAPER SIZE.SMALL Q = QUOTATION, FOLLOW WITH A LINE OF UP TO 255 }CHARACTERS, IT WORKS IN A SIMILAR WAY TO A BASIC REM STATEMENT AND WILL NOT BE PRINTED.SMALL S = SPACING, DEFAULTS TO 1 FOR }SINGLE LINE SPACING, 2 FOR DOUBLE, 3 FOR TRIPLE.SMALL W = WAIT, IS USEFUL ONLY TO THOSE WITH LETTER QUALITY OR SINGLE SHEET }PRINTERS. IT MAKES PAGE 6 WRITER TEMPORARILY STOP PRINTING UNTIL A KEY IS PRESSED.SMALL X = CONTROLS THE PAGE WIDTH AND DEFA }ULTS TO 80 FOR 80 COLUMN PRINTERS. USE 40 OR 132 FOR OTHERS.A VALUE AFTER THIS SYMBOL % INDICATES WHAT NUMBER TO START THE P }AGE NUMBERING FACILITY WITH DEFAULTS TO NUMBER 1.THE SYMBOL ? CAUSES PAGE 6 WRITER TO START PRINTING ONLY WHEN THE GIVEN NUM }BER IS REACHED.EXECUTION FORMATTINGTHESE COMMANDS CAN BE EITHER AT THE BEGINNING OF, OR EMBEDDED IN, A LINE OF TEXT, AGAI }N REMEMBER TO HOLD DOWN THE SELECT KEY WHEN ENTERING ONE OF THESE KEYS.THE SYMBOL # = CAUSES THE CURRENT PAGE NUMBER TO BE P }RINTED.SMALL C = CENTRES A LINE OF TEXT.PLACE AT THE BEGINNING OF THE LINE IF YOU ARE USING A 40 OR 132 COLUMN PRINTER REMEM }BER TO ALTER THE PAGE WIDTH.SMALL E = EDGE TO RIGHT MARGIN.ALL TEXT ON THE LINE FOLLOWING THIS COMMAND WILL BE BLOCKED FLUSH } TO THE RIGHT MARGIN.SMALL U = UNDERLINE MODE. USE ONE TO ENABLE UNDERLINING AND ONE TO DISABLE. IT WILL ONLY WORK ON PRINTE }RS THAT RECOGNISE CHARACTER STRINGS (8) AND (95) AS THE UNDERLINE ON/OFF CONTROL CODES. DISABLE. IT WILL ONLY WORK ON PRINTE X0063HINTS AND TIPS PAGETO WRITE A FULL A4 SIZE PAGE YOU SHOULD TYPE THESE COMMANDS AT THE VERY BEGINNING AND EACH C}OMMAND MUST HAVE IT'S OWN SEPERATE LINE.TO GET THEM JUST FOLLOW THESE INSTRUCTIONS CORRECTLY.THE SELECT KEY MUST BE HELD DOW}N WITH EACH LETTER !!!YOU MUST BE IN LOWER CASE LETTERS!!! IT IS NOT POSSIBLE TO GIVE AN EXAMPLE AS THE COMPUTER IS UNABLE} TO PRINT THEM AS THEY ARE DIRECT COMMANDS.HERE WE GO.AFTER PRESSING 'CAPS' HOLD DOWN SELECT AND PRESS 'T' YOU WILL SEE THE }LETTER 'T' SMALL AND IN INVERSE,THIS IS FOR THE AMOUNT OF SPACES DOWN THE PAPER WHERE YOU WANT TO START PRINTING. YOU M}UST NOW PUT IN A NUMBER FROM '0' TO SAY '75'.THE ZERO MEANS AT THE TOP OF THE PAGE AND 75 WOULD BE AT THE VERY BOTTOM OF THE }PAGE.ASSUMING YOU WANT TO START AT THE TOP OF THE PAGE YOU WOULD TYPE '0' AFTER THE 'T' AND THEN PRESS THE RETURN KEY.FOLLOW }THE SAME IDEA FOR EACH LETTER MENTIONED HERE.A BRIEF EXPLANATION FOLLOWS AS TO WHAT EACH LETTER AND NUMBER DOES.I HAVE FOUND} THAT I CAN GET 63 LINES INCLUDING SPACES ON A PIECE OF A4 SIZE PAPER,COMFORTABLY IF THE PAPER IS PLACED WITH THE TOP AT JUST} ABOVE THE OPEN SLOT ON TOP OF THE PRINTER.THE SMALL 'L' IS FOR THE LEFT HAND MARGIN AND CAN BE SET TO '0'.THE SMALL 'B' IS} TO COUNT THE LINES UP TO THE AMOUNT YOU WANT TO PRINT BUT THIS DOES NOT STOP THE PRINTER FROM OPERATING BUT THE NEXT INS}TRUCTION DOESIT IS SIMPLY A SMALL 'W' THIS MEANS WAIT AND WHEN THE PRINTER HAS REACHED THE SPECIFIED AMOUNT IT WILL STOP.TO }START IT AGAIN AFTER YOU HAVE PUT IN YOUR FRESH PAPER PRESS ANY KEY AND THE PRINTER WILL CONTINUE FROM WHERE IT LEFT OFF.THE }MAIN INSTRUCTIONS SHOULD BE READ AS WELL AS THESE.THEY MAY BE INCOMPLETE BUT THE BASIC IDEA IS THERE.****** SUMMARY ***}***SMALL LETTERS.HOLD DOWN SELECT KEY. PRESS LETTER AND THEN PRESS NUMBER THEN PRESS RETURN.THE LETTERS WILL BE INVERSE BUT} THIS HOW IT SHOULD LOOK AFTER EACH RETURN PRESSt0l0b63w PAGE 3RS WILL BE INVERSE BUTg008063 READ MEA voluntary payment of $2.50 is requested for this disk. I will give} any technical support I can to those who have paid this fee and include a S.A.S.E. with their questions. Write to the addres}s on the title page.This disk contains the first half of a reference manual for Atari 8 bit computers. The manual is written }for the Atari 800 but updates for XL/XE models are included. The files were written with ATARIWRITER and for an Epson MX80. Y}ou should be able to load them into another word processor and change them to work with it and a different printer. If you ha}ve ATARIWRITER and an Epson compatible printer, load and print each CHAP file (CHAP0 - CHAP10). Ignore the files with extensi}ons (i.e. CHAP1.1) as they will automatically chain to the CHAP files. Change the following codes for a different word proces}sor or printer.[CONTROL][O]27E starts NLQ mode " [O]27F stops NLQ mode " [O]27G starts BOLD mode " [O]}27H stops BOLD mode " [V]D:... chains new file " [E] page eject " [L] left margin " [R] } right margin " [T] top margin (half " [B] bottom margin lines) " [Y] page length "} " [C] center " [C][C] right justify " [B] bottom margin lines) " [Y] page length "4008063 ATARI SYSTEM REFERENCE MANUAL(c) 1987 By Bob DuHamel6915 Casselberry WaySan Die}go, CA 92119Atari is a registered trademark of Atari Corp.This manual contains highly technical information. Such informat}ion is provided for those who know how to use it. To understand the advanced information you are expected to know 6502 assemb}ly language. If you are new to programming, concentrate on the parts which discuss BASIC commands. Information important to B}ASIC programmers is in bold print.Addresses are usually given in both hexadecimal and decimal numbers. The operating system }equate names are given in capital letters with the address following in brackets. The decimal address is in parenthsis within} the brackets. For example: DOSVEC [$000A,2 (10)] name hex decThe ",2" after the hexadecimal number means that thi}s address requires two bytes to hold its' information. Any address called a "vector" uses two bytes whether noted or not. Con}trol registers and some other bytes of memory are shown in the following format : Register format 7 6 5 4 3 2 1 0 }----------------- | | ----------------- 1 6 3 1 8 4 2 1 2 4 2 6 8The numbers on to}p are the bit numbers. Bit 7 is the Most Significant Bit (MSB) and bit 0 is the Least Significant bit (LSB). The numbers on t}he bottom are the bit weights. These are useful when changing memory with decimal numbers, as you would in BASIC. For example}, to set bit 4 of a register to 1, without changing any other bits you would add 16 to the decimal number already in the regi}ster. To reset the same bit to 0, you would subtract 16 from the number in the register. This is exactly what the command GRA}PHICS 8+16 does. It sets bits 3 and 4 of a graphics mode control register.MSB and LSB may also mean Most Significant Byte or} Least Significant Byte, depending on context.CONTENTS 1 THE CENTRAL INPUT/OUTPUT UTILITY, (CIO) 2 THE DISK OPERATING }SYSTEM (D:) 3 USING THE DOS 2 UTILITIES (DUP.SYS) 4 THE CASSETTE HANDLER (C:) 5 THE KEYBOARD HANDLER (K:) 6 PRIN}TER HANDLER (P:) 7 SCREEN EDITOR (E:) 8 THE DISPLAY HANDLER (S:) 9 THE RESIDENT DISK HANDLER10 SYSTEM INTERRUPTS}11 THE FLOATING POINT ARITHMETIC PACKAGE12 BOOT SOFTWARE FORMATS13 THE SERIAL INPUT/OUTPUT INTERFACE (SIO)14 THE H}ARDWARE CHIPS15 DISPLAY LISTS16 PLAYER AND MISSILE (PM) GRAPHICS17 SOUND18 THE JOYSTICK PORTS19 MISC20 THE }XL AND XE MODELS DISPLAY LISTS16 PLAYER AND MISSILE (PM) GRAPHICS17 SOUND18 THE JOYSTICK PORTS19 MISC20 THE 008063CHAPTER 1THE CENTRAL INPUT/OUTPUT UTILITY, (CIO)The ATARI computer uses a very easy-to-use input and outpu}t system called the Central Input/Output utility, or CIO. Nearly all input or output passes through this utility. CIO uses ei}ght "channels" as paths for I/O. There are not really separate channels for I/O but the computer acts as if there were. Each }channel is controlled by a 16 byte block of memory called an Input/Output Control Block or IOCB. The channels are used by put}ting the proper numbers in the proper IOCB bytes then jumping to the CIO routine. In BASIC, complete I/O operations can be as} easy as typing a command such as LPRINT. In this case BASIC does all the work for you.THE CIO CHANNELSThere are eight CIO }channels, numbered from 0 to 7. In BASIC some channels are reserved for BASIC's use.BASIC CIO channel assignments Channel } 0 Permanently assigned to the screen editor 6 Used for graphics commands 7 Used for the Casse}tte, disk and printer.Channels 6 and 7 are free to use when they are not being used by BASIC.With machine language, all of t}he channels are available to the programmer.THE IOCB STRUCTURE The IOCB for channel zero starts at address $0340 (decimal 8}32). This is the only address you need to know. Indexing from this address is used to find all of the other bytes. Below are }the names and uses of the IOCB bytes.IOCB bytes and uses:ADDRESS NAME EXPLANATION $0340 ICHID handler Identi}fier $0341 ICDNO device number (disk) $0342 ICCOM command $0343 ICSTA status $0344 ICBAL buffer a}ddress (low byte) $0345 ICBAH buffer address (high byte) $0346 ICPTL address of put byte $0347 ICPTH ro}utine (used by BASIC) $0348 ICBLL buffer length (low byte) $0349 ICBLH buffer length (high byte) $034A ICAX}1 auxiliary information $034B ICAX2 - $034C ICAX3 the remaining auxiliary $034D ICAX4 bytes are rarel}y used $034E ICAX5 - $034F ICAX6 -ICHIDWhen a channel is open, the handler I.D. contains an index to the h}andler table. The handler table (to be discussed later) holds the address of the device handling routines. When the channel i}s closed ICHID contains $FF.ICDNOThe device number is used to distinguish between multiple devices with the same name, su}ch as disk drives.ICCOMThe command byte tells CIO what operation to perform.CIO command codes HEX } DEC +Open $03 3 +close $0C 12 get $07 7 put $09 11 } input $05 5 print $09 9 +status request $0D 13 +*special >$0D >13} + command may be made to a closed channel * device specific commandsICSTAThe status byte contains an error code if} something goes wrong. If bit 7 is 0 there have been no errors.ICBAL and ICBAHBefore a channel is opened, the buffer addr}ess bytes are set point to the block of memory which contains the name of the device the channel is to be opened to. Before a}ctual input or output these bytes are set to point to the block of memory where the I/O data is stored or is to be stored.I}CPTL and ICPTHThe put routine pointer is set by CIO to point to the handlers' put-byte routine. When the channel is closed }the pointer points to the IOCB-closed routine. This pointer is only used by BASIC.ICBLL and ICBLHThe buffer length bytes  }show the number of bytes in the block of memory used to store the input or output data. (See ICBAL and ICBAH.) If the amount } of data read during an input operation is less than the length of the buffer, the number of bytes actually read will be put  }in ICBLL and ICBLH by CIO.ICAX1 through ICAX6The auxiliary information bytes are used to give CIO or the device any speci }al information needed CIO.ICAX1 through ICAX6The auxiliary information bytes are used to give CIO or the device any speci008063 OPENING A CIO CHANNELBefore using a CIO channel it must be assigned to an I/O dev!}ice. In machine language you start by putting the channel number in the four high bits of the 6502 X register (X = $30 for ch!}annel three). Next you place the necessary codes (parameters) into IOCB 0 indexed by X. The X register will cause the numbers!} to be offset in memory by 16 times the channel number. This puts the numbers into the correct IOCB instead of IOCB 0. Below !}are the parameters used to open a channel. Channel-open parameters: ICCOM open code ICBAL address of device name I!}CBAH in memory ICAX1 direction code ICAX2 zeroThe direction code byte in ICAX1 takes on the following format:!} ICAX1 format for opening a channel 7 6 5 4 3 2 1 0 ----------------- ICAX1 | W R |!} ----------------- 8 4 2 1 W 1 = open for output (write) R 1 = open for input (read)!}ICAX1 may have the following data CIO direction codes HEX DEC operation $04 4 input $08 8 out!}put $0C 12 input and output (cannot change the length of a disk file)ICBAL and ICBAH point to the device name stor!}ed in memory. The device and file name must be followed by 0 or $9B (decimal 155). Once the parameters are set, jumping (JSR)!} to the CIO vector (CIOV) at address $E456 (58454) will cause the channel to be opened. In the following example a basic know!}ledge of assembly language is assumed. Routine to open channel 1 to the keyboard: ICHID = $0340 ICCOM = ICHID+2!} ICAX1 = ICHID+10 ICAX2 = ICHID+11 IOCB1 = $10 channel in four high bits CIOV = $E456 OPE!}N = $03 OREAD = $04 ;open for input ERROR = (address of error handling routine) START LDX IOCB1 !}LDA OPEN STA ICCOM,X LDA NAME STA ICBAH,X LDA OREAD S!}TA ICAX1,X LDA #0 STA ICAX2,X JSR CIOV BPL OK JMP ERROR ; NAME .BYTE "K:",$9B OK !} (program continues here)To open a CIO channel in BASIC the OPEN command is used. BASIC OPEN command format:OPEN #cha!}nnel,aux1,aux2,device:file name aux1 = direction code aux2 = special codeTo open channel 1 to the keyboard in BASIC Ty! }pe: OPEN #1,4,0,"K:"The third parameter, aux2, is a rarely used special parameter. One use is to keep the screen from erasi!!}ng when changing graphics modes. The fourth parameter is the device to open the channel to. It may be either a string in quot!"}es or a string variable.CIO device names C cassette recorder *D disk drive E screen editor K Keyb!#}oard P printer *R RS 232 I/O port S screen handler * Uses a non-resident handler loaded by the dev!$}ice at power-up. The device name must usually be followed by a colon. With the disk drive a file name is expected after the d!%}evice name. The screen handler is used for graphics. The screen editor uses both the keyboard handler and the screen handler !&}to work between the keyboard and screen.or graphics. The screen editor uses both the keyboard handler and the screen handler (008063USING AN OPEN CHANNELOnce a channel is opened to a device you have several options:INPUT:27H (ICCOM = $0%(}5)The computer reads data from the device until a carriage-return is read (decimal number 155, hex $9B) or the end of the fi%)}le (EOF) is reached. A carriage return is also known as an End-Of-Line or EOL. The IOCB input parameters are:IOCB input para%*}meters: ICCOM get record code ICBAL address of buffer to ICBAH store the data in ICBLL length of the data %+}ICALH bufferThe following routine demonstrates the input command in assembly language. Some of the equates are in the %,}channel opening example above.Input routine: GETREC = $05 BUFF = (address to store data at) BUFLEN%-} = (number of bytes available at storage address) : LDX IOCB1 LDA GETREC STA ICCOM,X L%.}DA < BUFF STA ICBAL,X LDA > BUFF STA ICBAH,X LDA < BUFLEN STA ICBLL,X LDA > B%/}UFLEN STA ICBLH,X JSR CIOV BPL OK2 JMP ERROR : OK2 (continues if no errors)If th%0}e data retrieved is shorter than the prepared buffer, the number of bytes actually read will be put into ICBLL and ICBLH.In %1}BASIC, the INPUT command is used.BASIC INPUT command format: INPUT #channel,string variable orINPUT #channel,arithmetic var%2}iableFor example: INPUT #1,IN$The above commands will cause the data from the device to be put into the specified buffer (I%3}N$ in the BASIC example) until an EOL is reached. If the INPUT statement is used again, without closing the channel, the comp%4}uter will get more data from the device until another EOL is read or the end of the file is reached. The new data will write %5}over the old data in the input string or buffer. If an arithmetic variable is used, only numbers can be input.PRINT: (ICCOM %6}= $09)In assembly language the print command is identical to the input command. The only difference is that the PUTREC code%7} ($09) is stored in ICCOM. Of course the buffer bytes of the IOCB then specify the block of memory to be output from rather t%8}han input to. With the print command, EOLs within the string or buffer are ignored but an EOL is placed at the end of the dat%9}a when sent to the device.In BASIC, the PRINT command is used like INPUT except you want to use a semicolon instead of a co%:}mma to separate parameters. For example:PRINT #1;OUT$ or PRINT #1;"HELLO". If you use a comma, ten space characters will be %;}sent before the string. If the print command is used again, without closing the channel, the new data will be appended to the%<} end of the data previously sent. Old data will not be written over.GET: (ICCOM = $07).In BASIC this command inputs a singl%=}e byte of data from the device. EOLs are ignored. In BASIC, GET is used like INPUT except an arithmetic variable must be used%>}. For example:GET #1,INIf the get command is used again the next byte from the device will be read. If the end of a file is%?} reached an error will occur. There is no command in BASIC to input an entire file without stopping at each EOL. If you wish %@}to ignore EOLs while reading a file to a string, you must use the GET command. Each byte of data is then put into the string %A}by the program.EXAMPLE: 10 OPEN #1,4,0,"D:TEST" 20 TRAP 60:REM GOES TO LINE 60 WHEN END OF FILE ERROR OCCURS 30 GET #1,IN%B} 40 IN$(LEN(IN$)+1)=CHR$(IN) 50 GOTO 30 60 CLOSE #1In assembly language, the get command can be used to get any number o%C}f bytes from the device. It works just as INPUT does except EOLs are ignored.IOCB get-byte parameters: ICCOM get-charac%D}ter (single byte) code ICBAL \ ICBAH same as in input ICBLL ICBAH /Other than the ICCOM code (GETCHR = $07) this%E} command is identical to the input command.PUT: 27H(ICCOM = $0B)In BASIC, PUT is the opposite of GET. It outputs a singl%F}e byte from a variable to the device. PUT is used the same as GET. For example: PUT #1,OUTIn assembly language, the command %G}byte of the IOCB is loaded with the put-character code (PUTCHR = $0B). Otherwise the PUT command is identical to GET.CLOSING%H} A CHANNELClosing a channel frees it for use by another device or for changing parameters. In assembly language the close co%I}de is put into the command byte of the IOCB then the CIOV call is made.IOCB close command: CLOSE = $0C : %J} LDX IOCB1 LDA CLOSE STA ICCOM,X JSR CIOVIn BASIC, use the CLOSE command followed by the channel number%K}. CLOSE #1With the disk drive, the file name is not put into the directory until the channel is closed.THE DEVICE TABLECIO%L} uses a jump table located at $031A (794). When a CIO call is made, CIO searches the table for the one-byte device name. The %M}two bytes following the device name contain the address of the device handler's vector table. CIO searches the device table f%N}rom the end, $033D (829) to the beginning. This way, if a custom handler has ben substituted for a resident handler, the cust%O}om handler will be found first. (custom handlers cannot be inserted directly in the place of resident handlers in the device %P}table.) Each handler has its own vector table. This vector table is 16 bytes long. The two-byte vectors point to the various %Q}handler routines. The vectors are stored in the vector table in the following order:Handler vector table order open %R} close get byte put byte get stat special JMP init code (3 bytes)The open routine should validate%S} the ICAX parameters and check for illegal commands. The close routine should send any remaining data in the buffer to the de%T}vice, mark the End-Of-File and update any directories, etc. The get byte routine should get a byte from the device or the han%U}dler buffer and put it in the 6502 A register. Handlers with long timouts must monitor the break key flag and put a $80 in th%V}e 6502 Y register if the [BREAK] key is pressed. The put byte routine should send the byte in the 6502 A register to the devi%W}ce or handler buffer. If the buffer fills, it should be sent to the device. BASIC can call the put byte routine without using%X} CIO.The get status routine may get 4 bytes of status information from the device and put them in DVSTAT [$02EA] to DVSTAT+3%Y}.For special commands the handler must examine the command byte and find the proper routine entry point.In all cases the st%Z}atus (error code) of the operation should be put in the 6502 Y register.To be compatible with all versions of the operating %[}system, the handler must redirect DOSINI [$000C,2 (12)] for initialization upon reset. This initialization must restore the v%\}ectors in the handler vector table and jump to the origional DOSINI vector.SPECIAL COMMANDSSome devices have special CIO co%]}mmands. These are known as device specific commands. In assembly language these commands are executed just as any other CIO c%^}ommand is. In BASIC the XIO command is used. An example of the XIO command is:XIO command code #channel,aux1,aux2,device:fil%_}e nameTo open a channel with the XIO command instead of the OPEN command use:XIO 3 #1,4,0,"K:"Note that the above command %`}is identical to the OPEN command except "XIO 3" is used instead of "OPEN". Also note that $03 is the IOCB open code for ICCO%a}M.Useful database variables and OS equatesDOSINI $000C,2 (12): initialization vectorBRKKEY $0011 (17): brea%b}k key flagICHID $0340 (832): start of IOCBsICDNO $0341 (833):ICCOM $0342 (834):ICSTA $0343 %c} (835):ICBAL $0344 (836):ICBAH $0345 (837):ICPTL $0346 (838):ICPTH $0347 (839):ICBLL $%d}0348 (840):ICBLH $0349 (841):ICAX1 $034A (842):ICAX2 $034B (843):HATABS $031A,16 (794)%e}: device handler tableCIOV $E456 (58454): CIO entry vector(842):ICAX2 $034B (843):HATABS $031A,16 (794)$B008063THE DISK OPERATING SYSTEM (D:)The disk operating system program (DOS) is also called the file management sy)g}stem (FMS). DOS is not a permanent part of the computer, it is loaded in upon power-up if a disk drive is attached to the com)q}b%DOS SYSb*)DUP SYSbCSAUTORUN SYSb'WORDPRCINSTbHINTSNTIPS b README bCHAPTER0 b CHAPTER1 b CHAPTER11 b?'CHAPTER12 b)fCHAPTER2 b5CHAPTER21 bECHAPTER3 bCHAPTER4 b&#CHAPTER5 bICHAPTER6 bMCHAPTER7 b2bCHAPTER8 b0CHAPTER81 #"CHAPTER82 #)CHAPTER83 #CHAPTER9 ##/CHAPT10 #%RCHAPT10 1 #7wCHAPT11 #2CHAPT12 puter.When the computer is turned on, one of the first things it does is send a request to the disk drive to load DOS into t)r}he computer. This startup operation is called booting. The word boot is short for bootstrapping -- the start-up process of ea)s}rly computers. The term comes from "lifting one's self by one's boot straps". Anytime the disk boots, the computer tries to )t}read a program starting at sector 1 and continuing in sequence. If the disk has DOS on it, the first three sectors, called th)u}e boot record, have a program which loads the DOS.SYS file. If there is no DOS.SYS file on the disk the computer will display)v}: -------------------- | BOOT ERROR | | BOOT ERROR | | BOOT ERROR | | BOOT ERROR | |)w} BOOT ERROR | | BOOT ERROR | | (etc.) | | | | | -----)x}--------------- When a disk is formatted, the drive read/write head passes over the entire disk and puts magnetic marks on i)y}t. These marks divide the disk into 32 concentric tracks. With DOS 2.0 each track is divided into 18 sectors, each holding 12)z}8 bytes of data. With DOS 2.5 there are 32 sectors per track giving a total of 1,024 sectors. Each sector on the disk is mark){}ed with a reference number from 1 to 720. Unfortunately, the writers of DOS 2.0 didn't know this so they wrote the DOS to use)|} sectors numbered from 0 to 719. As a result, DOS 2.0 cannot access sector 720. The designers of the disk drive were the guil)}}ty party in this case. It is normal to number from 0 in computers. With DOS 2.5, sectors 720 - 1,024 can be accessed normally)~}. Sector 720 can be accessed using the computer's resident disk handler. Some software writers use sector 720 to hide special)} information to make their programs difficult to copy.DOS 2 SECTOR ASSIGNMENTSSectors 1 through 3 are called the boot recor)}d. They contain a program which loads the DOS.SYS file into memory. Sector 360 is called the Volume Table of Contents or VTO)}C. The main purpose of the VTOC is to keep track of what sectors are occupied. Bytes 3 and 4 of the VTOC tell how many sector)}s are available. Starting at byte 10 is the Volume Bit Map. Each byte in the VBM tells the status of eight sectors. If a bit )}is a 1 the sector is available. If a bit is a 0 the sector is occupied.Sectors 361 through 368 contain the disk directory. E)}ach directory sector holds eight file names. The first byte of a file name is called the flag byte. It tells the status of th)}at file.Directory flag byte. 7 6 5 4 3 2 1 0 ----------------- | flag byte | -----------------Bi)}ts: 7 1 = file deleted 6 1 = file in use 5 1 = file locked 0 1 = open for outputThe next two )}bytes tell how many sectors are in the file. The two bytes after them tell the starting sector of the file. The last 11 bytes)} contain the file name.Sector 720 cannot be accessed with DOS 2.0.The boot record, VTOC, directory and sector 720 use 13 s)}ectors. This leaves 707 sectors for storing files with DOS 2.0.Each file sector has 125 bytes of data. The last three bytes )}tell how many bytes of the sector are used, what directory entry the sector belongs to and which sector is next in the file.)}File sector structure 7 6 5 4 3 2 1 0 ----------------- | data | byte 0 - - - - )} | bytes | byte 124 ----------------- | Dir. No. |hi | byte 125 ----------------- |forward point)}er| byte 126 ----------------- |S| byte count | byte 127 ----------------- hi = high 2 bits of forward )}pointer S = Short sector flag. 1 = short sector (End Of File)If the directory number does not match the order of the )}file name in the directory, an error 167 (file number mismatch) will occur.As a file is written to an empty disk it is put )}in consecutive sectors, 125 bytes at a time. After the file is written, the VTOC and directory are updated. When new files ar)}e written they also use consecutive sectors.When a file is deleted the status bit of the directory is changed to show that t)}he file has been deleted. DOS then tracks the file, sector by sector, to find what sectors are used. Finally the VTOC is upda)}ted to show that the deleted file's sectors are available for new files. The file is not erased from the disk; only the VTOC )}and directory are changed.When a file is deleted, an "island" of free sectors may be left on the disk. When a new file is t)}hen written to the disk it will first use these new free sectors. When the island is used up, DOS will skip over the occupied)} sectors to the next free sector. This is the reason for the sector link. A file can end up with it's sectors scattered all o)}ver a disk. It can be complicated but it's efficient.for the sector link. A file can end up with it's sectors scattered all o(5008063DISK FILE STRUCTUREThe first few bytes of a file may tell DOS or another program what kind of file it is. T-}hese information bytes are called a header. A text file is any file which has no header. A listed BASIC program is a type of -}text file. A letter from a word processor is another.A binary load file is a file intended to load to a specific address in-} memory. The first two bytes of a binary load file are decimal 255. The next two bytes hold the address at which the file is -}to load. The last two header bytes tell the ending address for the file. If the file is a program and is to run automatically-}, the initialization and run address are appended to the end of the file.binary load file header Decimal Hexad-}ecimal 255 identifier FF 255 FF 0 start 00 7 07 -} 15 end FF 8 08The above file would load at address $0700 (1792 decimal) and end a-}t address $08FF (2063). If a binary load file has initialization and run address appended to it they take on the following fo-}rmat:Init and run tailer CHR Decimal Hexadecimalinit address format [b] 226 identifier E2 | -} 2 02 [c] 227 E3 | 2 02 n address nn -} n nnrun address format [diamond] 224 identifier E0 | 2 02 [a] 225 -} E1 | 2 02 n address nn n nn [ ]=inverse videoA-} program which doesn't need special initialization can be run at the init address. Otherwise, an RTS instruction is expected -}at the end of the initialization section. The computer will then jump to the run address if specified.INSIDE THE COMPUTER-}DOS uses the computer's CIO utility. When a DOS disk is booted a non-resident handler is loaded into memory. A new handler n-}ame, D, is then added to the handler table. When CIO is called with a device name of D: or Dn:, CIO will search the handler t-}able for that device name. If the 'D' is found, the next two bytes in the table point to the DOS entry address.DOS FILE NAM-}E CONVENTIONSDOS is unique among CIO handlers in that it requires an eight character file name to follow the device name. -}This file name may be followed by a period and then a three character extender.EXAMPLES: D:TEST, D2:FIREMAN, D:VENTURE.EXE, -}D:CHAPTER.001The D2: is used for drive number two if present. The file name must use upper-case letters or numbers. The firs-}t character must always be a letter. WILD CARDSThe characters * and ? may be used as wild cards. * means any combination -}of characters and ? means any single character.EXAMPLES: D:P* any file beginning with P and without an extender -}D:*.EXE any file with the extender .EXE D:*.* any file. D:F?REMAN one unknown character, FIREMAN or-} FOREMAN will matchWild cards can only be used to load, delete, lock and unlock files. When loading a file using wild cards,-} only the first matching file will be loaded.When renaming a file, both the new and old names are expected after the device -}name.EXAMPLE: D:OLDNAME.BAS,NEWNAME.BASTo format a disk, only the device name (D: or Dn:) is needed.USING DOSWhen a CIO c-}hannel is opened to the disk drive it must actually be opened to a specific file on the disk. The device name in the open com-}mand must be followed by a file name.When a channel is opened to the disk, two special parameters may be used in ICAX1.ICAX-}1 for disk open: 7 6 5 4 3 2 1 0 ----------------- | W R D A| ------------------} D 1 = open to read the directory instead of a file A 1 = append data to the end of the fileThis gives the following -}extra ICAX1 options.Disk specific ICAX1 options: HEX DEC $06 6 open to read directory $-}09 9 output, append to the end of an existing fileREADING THE DIRECTORYWhen the directory is read, each fil-}e name is treated as if it were followed by an EOL. A loop must be used to read all of the file names in the directory. The l-}ast entry read is the free sector count. After it is read, another read operation will result in an End-Of-File error.The di-}sk drive has a number of device specific commands other than the regular CIO commands. From BASIC the XIO command is used to -}access these commands. The XIO command allows you to directly load the IOCBs from BASIC. Each parameter of the XIO command p-}laces values in certain bytes of an IOCB.XIO command format: XIO command channel,aux1,aux2,device:file nameNote that the-} parameters resemble the BASIC OPEN command. The BASIC OPEN command is identical to it's equivalent XIO command.XIO commands-} specific to the disk drive.RENAME XIO $20 (32)DELETE XIO $21 (33)LOCK XIO $23 (35)UNLOCK XIO $2-}4 (36)POINT XIO $25 (37)NOTE XIO $26 (38)FORMAT XIO $FE (254)EXAMPLES: XIO 33 #1,0,0,"D:JUNK" = -}delete file named D:JUNK XIO 32 #1,0,0,"D:OLD,NEW" = change name of D:OLD to D:NEWNOTE and POINT can also be used directly-} from BASIC. NOTE finds the current position of the read/write head on the disk. POINT moves the read/write head to the desir-}ed position.USING NOTE AND POINTThe command format for NOTE and POINT is as follows:NOTE \ channel,sector,bytePOIN-}T/EXAMPLE:NOTE #1,SECT,BYTEBASIC requires the sector and byte parameters in both commands to be variables. Fixed number-}s cannot be used. If you try to do a POINT to a sector outside the file the channel is open to, a point error will occur. Ca-}re may need to be taken to be sure the file being accessed is in contiguous sectors on the disk. If it is not, it will be dif-}ficult to know where to do points to.One use of NOTE is to use the command immediately after opening a channel to a disk fil-}e. After the NOTE command, the parameter variables contain the coordinates of the first byte of the file. They can then be us-}ed as a reference for the POINT command.In assembly language, ICAX3 and ICAX4 are used for the sector number (lsb,msb). ICA-}X5 is used for the byte number.STATUS REQUESTIf the status request command is used, one of the following values will be fou-}nd in ICSTA and the 6502 Y register. HEX DEC $01 1 OK $A7 167 file locked -} $AA 170 file not found HEX DEC $01 1 OK $A7 167 file locked ,&008063USING THE DOS 2 UTILITIES (DUP.SYS)If you boot a DOS disk with no cartridge in the slot or with BASIC disab1}led (by holding the OPTION key), DOS will try to load the file named DUP.SYS. This is the disk utility file. When using BASIC1}, typing DOS [RETURN] will load the DUP.SYS file. When the utilities are loaded the menu will appear on the screen.THE DOS U1}TILITIES MENUDISK OPERATING SYSTEM II VERSION 2.0S COPYRIGHT 1980 ATARIA. DISK DIRECTORY I. FORMAT DISKB. RUN CARTRIDGE 1} J. DUPLICATE DISKC. COPY FILE K. BINARY SAVED. DELETE FILE(S) L. BINARY LOADE. RENAME FILE M. RUN AT ADDRESS1}F. LOCK FILE N. CREATE MEM.SAVG. UNLOCK FILE O. DUPLICATE DISKH. WRITE DOS FILES SELECT ITEM OR [RETURN] FOR ME1}NU[A] DIRECTORYAfter pressing [A] [RETURN] you will get the prompt: DIRECTORY--SEARCH SPEC,LIST FILE?If you want to s1}ee the entire directory just press [RETURN] again. If you wish, you may type in a specific file name (D: is optional) or wild1} cards to search for. If you specify a search spec only matching files will be displayed. If you want, you can have the direc1}tory sent to another device. To do this type a comma and the device name. For example, if you type ,P: the directory will be1} sent to the printer.[B] RUN CARTRIDGEIf a cartridge was inserted or BASIC was not disabled when the computer was turned on1}, [B] [RETURN] will run that cartridge or BASIC.[C] COPY FILEThis option will copy a file to another part of the same disk 1}(with a different file name) or copy from one disk drive to another. When you press [C] [RETURN] you will be given the prompt1}: COPY--FROM,TOType the devices and file names separated by a comma.EXAMPLES:FOREMAN,FIREMAN or D1:TEST,D2:TESTThe fi1}rst example will copy to the same disk. The second example will copy from disk drive one to disk drive two. If you want to ha1}ve the first file appended to the end of the second file type /A after the file names.EXAMPLE:RUNMENU.EXE,AUTORUN.SYS/AIf1} the files are binary load files, this will cause both files to be saved as one file. When the load command is used they wil1}l both be loaded and run.[D] DELETE FILE(S)After pressing [D] [RETURN] you will get the prompt: DELETE FILE SPECAfter typ1}ing the file name you will be asked to confirm the file to delete. DELETE FILE SPEC DELETE-D1:JUNK ARE YOU SURE?Press [Y] 1}if the correct file is displayed. If you use wild cards you will be asked to confirm each matching file.[E] RENAMEUpon typi1}ng [E] [RETURN] you will be given the prompt: RENAME-GIVE OLD NAME,NEWType the file name you want to change and the new nam1}e separated by a comma.EXAMPLE:COLT,HORSEWARNING! Do not rename a file to a name which already exists on the disk. You wil1}l end up with a duplicate file name and will not be able to access one of them. Attempting to rename or delete one of them wi1}ll rename or delete both. The only way to fix a duplicate file name is with a sector editor or other special utility.[F] LOC1}K FILEA locked file cannot be written to, renamed or deleted. To lock a file type [F] [RETURN]. You will get the prompt: WH1}AT FILE TO LOCK?Type the file name you want to lock. Wild cards will cause all matching files to be locked.[G] UNLOCK FILE1}Used the same as lock.[H] WRITE DOS FILESThis option will write the DOS.SYS and DUP.SYS files to a formatted disk. When y1}ou type [H] [RETURN] you will receive the prompt: DRIVE TO WRITE DOS FILES TO?Type the number of the drive. If the drive co1}ntains a formatted disk the dos files will be written to it.[I] FORMAT DISKThis option formats a new disk or erases a disk 1}with files on it. Typing [I] [RETURN] will get you the prompt: WHICH DRIVE TO FORMATBe sure you have the correct disk in th1}e proper drive then type the drive number. It is impossible to recover files on a disk formatted by accident.While the disk 1}is being formatted the drive will check to be sure the disk is formatted correctly. If not, the drive attempt to format the d1}isk again. If the disk is defective the drive will not finish the formatting process.[J] DUPLICATE DISKThis option will cop1}y an entire disk except for sectors listed as free in the VTOC. Some programs are copy-proofed by changing the VTOC to show t1}hat some occupied sectors are empty. For such disks, a program which copies the entire disk is needed.When you press [J] [RE1}TURN] you will be given the prompt: DUP DISK--SOURCE,DEST DRIVES?If you are using only one disk drive, type 1,1. If you hav1}e only one drive you will be told when to swap disks.[K] BINARY SAVEThis option saves a block of memory as a binary load fi1}le. When you type [K] [RETURN] you will be given the prompt: SAVE-GIVE FILE,START,END(,INIT,RUN)Type the desired file name 1}and a comma. Now type the start and end addresses of the memory block to be saved, in hexadecimal numbers, separated by comma1}s. If the file is a program which is to automatically run when loaded, give the initialization address, if needed, then the r1}un address.EXAMPLE:CHASE.EXE,0700,09FF,,0700This will save the block of memory from address 0700 to 09FF. The program is n1}ot initialized before running so there is no address typed after the third comma. When the program is loaded the computer wil1}l jump to address 0700, as specified in the last parameter, to run the program.[L] BINARY LOADTo load a binary file type [L1}] [RETURN]. You will get the Prompt:LOAD FROM WHAT FILE?Type the file name and the file will be loaded. If wild cards are u1}sed, only the first matching file will be loaded.[M] RUN AT ADDRESSTyping [M] [RETURN] will get the prompt:RUN FROM WHAT A1}DDRESS?Type the hexadecimal address of the program you want to run.[N] CREATE MEM.SAVA MEM.SAV file is used by BASIC and s1}ome other programs to save the part of memory which the DUP.SYS file loads into. If there is no MEM.SAVE file on the disk whe1}n you go to the DOS utilities, you will loose that part of memory. With BASIC you will loose your program.When you type [N] 1}[RETURN] you will get the prompt: TYPE Y TO CREATE MEM.SAVTyping [Y] [RETURN] will create a MEM.SAV file on the disk in dri1}ve one.[O] DUPLICATE FILEThis option is used to copy a file from one disk to another, using only one disk drive. When you t1}ype [O] [RETURN] you will get the prompt: NAME OF FILE TO MOVE?If you use wild cards you will be asked to swap disks for ea2}ch matching file.DOS 2.5 also has option:[P] FORMAT SINGLEDOS 2.5 normally formats disks to use "enhanced" density. This o2}ption will format a disk in single density for use with the 810 drive.DOS 2.5 also has some special utilities on the master 2}disk. Use the binary load option to run them.RAMDISK.SYSThis program will cause the extra bank of memory in the 130XE to ac2}t like a disk drive (called D8:). If this program is on the disk it will automatically run. It need not be renamed to AUTORUN2}.SYS.COPY32.COMCopies DOS 3 files to DOS 2.DISKFIX.COMCan make certain "repairs" to a disk, such as restoring deleted fil2}es.SETUP.COMUsed to change the default configuration of DOS.AUTORUN.SYS (DOS 2.0 and 2.5)This program is needed to operat2}e the RS-232 ports on the 850 interface. If you don't want this program to automatically load when you boot with the master d2}isk, rename the file to RS232.SPECIAL DOS INFORMATIONWhen DOS is in memory, changes can be made to the DOS program. These c2}hanges can be made by poking the changes into memory. If you want to make the changes permanent, you can type DOS [RETURN] to2 } load the utilities. From the utilities menu you can use the write DOS files option to save the changes on disk. Some of the2 } useful changes you can make follow. POKE 1913,80This turns off the write verify and speeds up disk writing. POKE 1913,872 }This turns write verify on POKE 5903,42 POKE 5904,46 POKE 5905,82 POKE 5906,85 POKE 5907,78 POKE 5908,155This causes 2 }any binary file with the extender .RUN to be loaded automatically when the computer is turned on. POKE 5903,65 POKE 5904,82 }5 POKE 5905,84 POKE 5906,79 POKE 5907,82 POKE 5908,85This returns the DOS to normal, Automatically loading files named 2}AUTORUN.SYS. DOS 2.0 DOS 2.5 POKE 3772,255 POKE 3818,64 POKE 3774,64 POKE 3822,2}123 POKE 3778,123This will cause DOS to accept lower-case as well as upper-case letters in file names. It will also n2}ow accept @,[,\,],^ and _ . POKE 3772,223 POKE 3818,65 POKE 3774,65 POKE 3822,91 POKE 3772}8,91 This will change DOS back to normal, accepting only upper-case letters and numbers.74,65 POKE 3822,91 POKE 3770Z008063THE CASSETTE HANDLER (C:)The cassette handler sends data to the cassette recorder in blocks of 128 bytes ea6}ch. The blocks are sent in the following format:Cassette record format ----------------- |0 1 0 1 0 1 06} 1| speed measurement bytes ----------------- |0 1 0 1 0 1 0 1| ----------------- | 6}control byte | ----------------- | 128 | = data = | bytes 6} | ----------------- | checksum | handled by SIO -----------------The control byte may h6}ave one of the following values. $FC (252) record is full. $FA (250) partly full, next record is EOF. $FE (254) 6} EOF record, data section is all zeroes.The cassette handler has two modes of operation. The first mode uses only a short 6}gap between records. It is called the no IRG (interrecord gaps) mode. The second mode uses longer gaps between records and is6} called the IRG mode. In the IRG mode the computer may stop the cassette recorder between records for processing data.When a6} channel is opened to the cassette recorder, bit 7 of ICAUX2 may be set to 1 (ICAX2 = $80 (128)). This will cause the cassett6}e to use the no IRG mode. A cassette file starts with a 20 second mark tone. This tone is followed by the file records with 16}28 data bytes each. The final record is an End-Of-File record.The cassette is a straight-forward read/write device. There ar6}e no special functions other than those common to other CIO devices.The cassette motor is controlled by one of the controlle6}r port control registers. If bit 3 of PACTL [$D302 (54018)] is 0 then the cassette motor is on. The following BASIC commands 6 }will turn the cassette motor on and off.Cassette motor control. POKE 54018,PEEK(54018)-8 motor on POKE 54018,PEEK(546!}018)+8 motor offUseful data base variables and OS equatesPACTL $D302 (54018): port A control register, bit 46"} controls cassette motor.ul data base variables and OS equatesPACTL $D302 (54018): port A control register, bit 44008063THE KEYBOARD HANDLER (K:)The keyboard is a read only device and therefore the keyboard handler has no outpu:$}t functions. The keyboard handler reads the keys as ATASCII codes. Each key is represented by one byte of data. Therefore, ea:%}ch time a key is pressed the data is treated as a byte of data just as data from any other device is. The only difference is:&} that the computer must wait for the operator to press the keys as it reads the data.Whenever a key is pressed an IRQ interr:'}upt is generated by the keyboard reading hardware. The internal code (not ATASCII) for the key just pressed is then stored in:(} CH [$02FC (764)]. The code is then compared with the prior key code in CH1 [$02F2 (754)]. If the code in CH1 is different fr:)}om the code in CH, the key is accepted. The code is then converted to ATASCII, and placed in the database variable ATACHR [$0:*}2FB (763)]. On XL and XE models, KEYDEF [$0079,2 (121)] points to the key-code-to-ATASCII conversion table. (This address is :+}used by the the screen handler in 400/800 models).If the code in CH1 is the same as the code in CH, the new key code will no:,}t be accepted unless the key debounce timer, KEYDEL [$02F1 (753)] is 0.When CIO is told to do an input operation from the ke:-}yboard, CH is checked to see if a key has been pressed. If CIO finds $FF (255) in CH, it waits until a key is pressed. If CH :.}is not $FF, a key has been pressed and the ATASCII code for that key is taken from ATACHR. CH is then set to $FF.The data in:/} CH is in the following format.Key code format: 7 6 5 4 3 2 1 0 ----------------- |C|S| key cod:0}e | ----------------- C 1 = [CTRL] key is pressed S 1 = [SHIFT] key is pressedAnytime a key is pressed, CH:1} is loaded with the key code. CH will hold the code until the computer is commanded to read the keyboard. Sometimes the compu:2}ter will read a key which was pressed long ago. If you want to prevent this, load CH with $FF before reading the keyboard. (I:3}n BASIC use POKE 764,255.) This will clear out any old key pressings.Special function keys [CTRL][1] screen outpu:4}t start/stop [CTRL][2] BELL [CTRL][3] Generates End-Of-File status [/|\] or [/] inverse video toggle:5} [CAPS LOWER] sets lower case [CTRL][CAPS] sets CTRL lock [SHIFT][CAPS] sets caps lockKEYBOARD REPEAT D:6}ELAY AND RATE CONTROLOn the XL and XE, KRPDEL [$02D9 (729)] determines the delay before the key repeat begins. The value of:7} this byte is the number of vertical blanks (1/60th second each) to delay. KEYREP [$02DA (730)] determines the repeat rate in:8} vertical blanks.KEYBOARD CLICKThe keyboard click of the XL/XE is heard through the TV speaker. The click may be turned off:9} by putting $FF in NOCLIK [$02DB (731)].NON-HANDLER, NON-CIO KEYSThe [OPTION], [SELECT] and [START] keys are read from the ::}console switch register, CONSOL [$D01F (53279)].The console switch register 7 6 5 4 3 2 1 0 ---:;}---------------------- CONSOL |0 |0 |0 |0 |SP|OP|SE|ST| ------------------------- 8 4 2:<} 1 ST 0 = [START] SE 0 = [SELECT] OP 0 = [OPTION] SP Console speaker. set to 1 during vertical blank. :=}Toggleing this bit operates the speaker (which is heard through the TV on XL/XE models). This bit always reads 0The [HELP] :>}key on XL and XE models is read from HELPFG, [$02DC (732)]. This address is latched and must be reset to zero after being rea:?}d.The [HELP] key register 7 6 5 4 3 2 1 0 ----------------- HELPFG |C S 0 H 0 0 0 H| :@}----------------- 1 6 3 1 8 4 2 1 2 4 2 6 8 H 1 = [HELP] (bits 0 and 4) S 1:A} = [SHIFT] C 1 = [CONTROL]Useful database variables and OS equatesKEYDEF $0079,2 (121): key code coversion tabl:B}e vector (XL/XE)KRPDEL $02D9 (729): delay before key repeat (XL/XE)KEYREP $02DA (730): key repeat rate (XL/XE):C}NOCLIK $02DB (731): $FF turns off key click (XL/XE)HELPFG $02DC (732): [HELP] key (XL/XE)ATACHR $02FB (76:D}3): ATASCII Code for last keyCH $02FC (764): keycode, $FF if no key has been pressedBRKKEY $0011 (17): bre:E}ak key flag, 0 = break key pressedSRTIMR $022B (555): Key delay and repeat timerSHFLOK $02BE (702): SHIFT/CTRL :F}lock flag$00 = lower case$40 (64) = upper case lock$80 (128) = CTRL lockINVFLG $02B6 (694): inverse video flag:G}, non-zero = inverseCONSOL $D01F (53279): start, select and option keysIRQEN $D20E (53774): IRQ interrupt enableb:H}it 7 enables [BREAK] bit 6 enables other keysshadow registersPOKMSK $0010 (16): IRQEN shadow IRQ interrupt enableb8f008063THE PRINTER HANDLER (P:)The printer is a write only device so the printer handler has no input functions. T>J}he printer handler has no special functions other than the CIO functions common to all other devices. Although many printers >K}have special functions, the printer handler has no control over them. See your printer manual for information on special func>L}tions.pecial functions, the printer handler has no control over them. See your printer manual for information on special func<008063SCREEN EDITOR (E:)The screen editor uses both the keyboard handler and the screen handler to provide interaBN}ctive control of the computer. In fact, the keyboard handler, the screen handler and the screen editor are contained in a sinBO}gle section of code and are therefore very closely related.The editor works with one line of characters at a time. The linesBP} it works with are called logical lines and are up to three screen lines long.The screen editor inputs data from the keyboarBQ}d and then prints the data on the screen. When the [RETURN] key is pressed, the editor inputs all of the data on the present BR}logical line for processing by CIO.If characters are typed on the screen, and then the cursor is moved off the line, then baBS}ck on the line, and new characters are typed, only the characters to the right of the reentry point of the cursor are input wBT}hen [RETURN] is pressed. However, if the cursor is moved off the line again, then moved back on, all characters on that logicBU}al line are input.If bit 0 of ICAX1 is 1, the editor will act as if the [RETURN] key is being held down. This bit may be chaBV}nged at any time.Editor control codesThe screen editor treats certain ATASCII codes as special control codes.Screen editorBW} control codes KEY HEX DEC FUNCTION [RETURN] $9B 155 carriage return or EOL [CBX}LEAR] $7D 125 Clear screen,put cursor in upper left [UP ARROW] $1C 28 Move cursor up one screBY}en line [DOWN] $1D 29 down one line [LEFT] $1E 30 left one character [RIGHT] BZ} $1F 31 right one character [BACK S] $7E 126 Back-space operation [SET TAB] $9F 15B[}9 sets tab stop at cursor [CLEAR TAB] $9E 158 Clear tab stop at cursor [TAB] $7F B\} 127 move to next tab stop [SHIFT] [INSERT] $9D 157 Make space for a new line [SHIFT] B]} [DELETE] $9C 156 delete the logical line at the cursor [CTRL] [INSERT] $FF 255 make rB^}oom for a character [CTRL] [DELETE] $FE 254 delete character at cursor [ESCAPE] $1B 27 B_} causes next non-EOL code to be displayed as an ATASCII character, even if it is an editor control code [CTRL] [1] sB`}creen print start/stop [CTRL] [2] $FD 253 rings bell, no effect on display [CTRL] [3] creats End-Of-File statusBa} Useful database variablesDSPFLG $02FE,1 (766): if > 0 then control codes displayed.3] creats End-Of-File status@a008063THE DISPLAY HANDLER (S:)The display handler manages the computer's video display. Although no data ever leaFc}ves the computer through it, the display is treated like any other CIO device. Data sent to the screen may be displayed as eiFd}ther characters or point by point graphics. Although it is only visible in the 40 column text mode, mode 0, there is a cursorFe} on the screen in all of the text or graphics modes. Whenever a character or graphics point is put on the screen, the cursor Ff}moves just as in mode 0.The display is capable of both input and output. Information can be put on the screen with any of thFg}e CIO output commands. An input command will find whatever is on the screen at the position of the cursor.When text or graphFh}ics is sent to the screen it is actually stored in an area of memory called the display buffer. What you see on the screen isFi} the computer's interpretation of the data stored there. This will be explained further as each mode is covered.DISPLAY HANDFj}LER SPECIAL FUNCTIONS: DRAW and FILLSPECIAL ERROR STATUSES: $84 (132) Invalid special command. $8D (141) CursFk}or out of range. $91 (145) Nonexistant screen mode. $93 (147) Insufficient ram for screen mode.TEXT MODE 0In grapFl}hics mode 0, data passes through CIO, and is stored in the display buffer in the following format. 7 6 5 4 3 2 1 0 Fm} ----------------- |I| Data | ----------------- 1 = displays character in inverse video.Bits 0 through 6 Fn}select one of the 128 characters in the ATASCII set. If bit seven = 1, the character is displayed in inverse video. ConvertinFo}g the above byte to decimal will give the BASIC ASC(x) equivalent. The characters displayed in the text modes are determined Fp}by tHE ATASCII character set. This is a bit by bit representation of how the characters appear on the screen. The character sFq}et starts $E000 (57344) in the operating system ROM. From there, for 1K of memory, each eight bytes holds a "bit map" of a paFr}rticular character. Below is how the letter A is stored in the character set.Letter A as represented in the C-set 7Fs} 6 5 4 3 2 1 0 ----------------- $E208 |0 0 0 0 0 0 0 0| ----------------- |0 0 0 1 1 0 0 0| Ft} * * ----------------- |0 0 1 1 1 1 0 0| * * * * ----------------- |0 1 1 0 0 1 1 0| Fu}* * * * ----------------- |0 1 1 0 0 1 1 0| * * * * ----------------- |0 1 1 1 1 1Fv} 1 0| * * * * * * ----------------- |0 1 1 0 0 1 1 0| * * * * ----------------- $E20F |0 Fw}0 0 0 0 0 0 0| -----------------XL and XE models have an international character set starting at $CC00 (55224). In tFx}his character set the graphics characters are replaced by international characters.Custom characters sets may be loaded at aFy}ny free address which is a multiple of 1,024 ($0400, or 1K). The database variable CHBAS [$02F4 (756)] stores the most signifFz}icant byte (MSB) of the address of the active C-set. Since the LSB of the C-set address is always $00, no LSB is needed to fiF{}nd it.The data stored in the display buffer does not use the ATASCII code. A special code needed by the ANTIC chip is used.F|}DISPLAY CODE / ATASCII CODE CONVERSION: ATASCII display $00 - $1F ( 0 - 31) = $40 - $F}}5F (64 - 95) $20 - $5F (32 - 95) = $00 - $3F ( 0 - 63) $60 - $7F (96 - 127) = unchangedThe codes for inverF~}se video (the above codes with bit 7 set (= 1) or the above codes + 128 in decimal) are treated likewise.When you first turnF} on the computer, BASIC opens channel 0 to the screen editor (E:). The screen editor uses both the keyboard handler and the sF}creen handler, in mode 0, to display characters when they are typed in.TEXT MODES 1 AND 2Graphics modes 1 and 2 offer a spF}lit screen configuration if desired. The split screen has four lines of mode 0 at the bottom of the screen.In mode 1 the scrF}een holds 20 characters horizontally and 24 characters vertically. In mode 2 the characters are twice as tall so the screen hF}olds 12 vertically.In BASIC, characters are sent to the screen with the PRINT command. Since BASIC uses channel 6 for graphiF}cs you must specify channel 6 in the command. For example: ? #6;"HELLO"If you use a comma in place of the semicolon, tenF} spaces will print before the "HELLO". You can also use the PLOT and DRAWTO commands. In this case the COLOR command determinF}es the character, as well as the color to be displayed.Data passes through CIO in the following form: 7 6 5 4 3 2 1 0F} ----------------- | C | D | ----------------- C determines the color. C Default ColorF} Shadow Color Register Register 0 green COLPF1 COLOR1 1 gold CF}OLPF0 COLOR0 2 gold COLPF0 COLOR0 3 green COLPF1 COLOR1 4 red F}COLPF3 COLOR3 5 blue COLPF2 COLOR2 6 blue COLPF2 COLOR2 7 red F} COLPF3 COLOR3D is a 5 bit ATASCII code which selects the character to be displayed. The database variable CHBAS selects F}between upper case (CHBAS=$E0 (224)) and lower case (CHBAS=$E2 (226)).GRAPHICS MODES 3 THROUGH 11Modes 3 through 8 offer aF} split screen mode. In modes 9 through 11 special programming is required for split screens.These modes use dot by dot (pixeF}l by pixel) graphics instead of character sets. Before explaining how graphics are sent to the screen through CIO, I will desF}cribe how the data in the display buffer is interpreted by the ANTIC chip.Mode 8 is the simplest of the graphics modes. EachF} byte of the display buffer controls eight pixels horizontally. The first 40 bytes of the display buffer control the first hoF}rizontal line of graphics. This makes a total of 320 pixels horizontally. If one of the eight bits of a byte is a 1 then the F}pixel it controls is on. If a bit is a 0 then it's pixel is off. For example, if a particular byte is equal to $9B (binary 10F}011011) then its' part of the screen would look like... * ** ** (10011011)a particular byte is equal to $9B (binary 10DQ008063In reality the pixels are assigned to different color registers. A color register is a byte of memory which cJ}ontrols the color of all pixels assigned to it. In mode 8, if a bit is = 0 it's pixel is assigned to the register called COLBJ}K. If a bit is one, it's pixel is assigned to COLPF0. See COLORS below for more information on the color registers.You may nJ}otice a close similarity between mode 0 and mode 8. The major difference between these modes is where the dot by dot informatJ}ion comes from. In mode 8 this information comes from the display buffer. In mode 0 the display buffer contains codes tellingJ} what characters to display. The actual dot by dot information comes for the character set at $E000.In mode 7 each pixel is J}controlled by two bits. Therefore each byte only controls four pixels. There are also only 1/4 as many pixels on the screen aJ}s in mode 8. See mode 3 below for an explanation of how the each byte affects the pixels.In a graphics mode, when CIO sends J}a byte of data to the screen handler, that byte has information for only one pixel. Do not confuse a byte which CIO sends to J}the screen handler with the bytes in the display buffer.CIO sends data to or retrieves data from the screen in the followingJ} forms. 7 6 5 4 3 2 1 0 ----------------- |0 0 0 0 0 0| D | Modes 3,5,7 -- D = color -----------------J} ----------------- |0 0 0 0 0 0 0|D| Modes 4,6,8 -- D = Color ----------------- ----------------- J} |0 0 0 0| D | Modes 9,10,11 -- D = data -----------------Mode 3 uses a screen which is 40 pixels horizontally aJ}nd 24 vertically. Each pixel is a square the size of a mode 0 character. It requires 273 bytes of RAM where each byte controlJ}s 4 pixels. Each pair of bits controls which of the four color registers their pixel is assigned to.display buffer byte for J}mode 3 7 6 5 4 3 2 1 0 ----------------- | D | D | D | D | ----------------- P1 P2 P3 P4 PixelJ}/color register assignments: D = 00 COLBK (COLOR4) 01 COLPF0 (COLOR0) 10 COLPF1 (COLOR1) 11 J} COLPF2 (COLOR2)Mode 4 uses a screen of 80 columns by 48 rows. Each pixel is half the size of those in mode 3. Mode 4 rJ}equires 537 bytes of RAM where each byte controls 8 pixels. This mode is very similar to mode 8 except there are fewer but laJ}rger pixels.Mode 5 uses a screen of 80 columns by 48 rows. The pixels are the same size as in mode 4. Mode 5 requires 1,017 J}bytes of RAM where each byte controls 4 pixels in the same manner as in mode 3.Mode 6 uses a screen of 160 columns by 96 rowJ}s. It requires 2,025 bytes of RAM where each byte controls 8 pixels as in mode 4.Mode 7 uses a screen of 160 columns by 96 rJ}ows. It requires 3,945 bytes of RAM where each byte controls 4 pixels as in modes 3 and 5.Modes 8 through 11 (and 15 on XL aJ}nd XE models) each require 7,900 bytes of RAM and are very similar in display set up. The main differences between these modeJ}s is the interpretation of data in the display buffer.Mode 15 (sometimes called mode 7.5) uses a screen of 160 columns by 19J}2 rows. Each byte controls 4 pixels as in mode 7. The main difference between mode 15 and its related modes is bit 0 of each J}instruction byte in the display list (the program which the ANTIC chip uses). If this bit is 0 the screen is interpreted as mJ}ode 15. If the bit is 1 the screen is interpreted as modes 8 through 11.Modes 8 through 11 are set up identically in memory,J} including the display list. The only difference is the data in the PRIOR register of the GTIA chip. The shadow register for J}PRIOR is GPRIOR [$026F (623)].Mode 8 (PRIOR = $00 - $3F (0 - 63)), uses a screen of 320 columns by 192 rows. Each byte contrJ}ols 8 pixels as in modes 4 and 6.Mode 9 (PRIOR = $40 - $7F (64 - 127)) uses a screen of 80 columns by 192 rows. Each byte coJ}ntrols 2 pixels.The pixels are all of the same color, controlled by COLBK. Each half of a byte in the display buffer controlsJ} the luminance of the assigned pixel. The format of each byte is as follows. 7 6 5 4 3 2 1 0 ----------------- J} | data | data | ----------------- pixel 1|pixel 2Mode 10 (PRIOR = $80 - $BF (128 - 191), is the same as modeJ} 9 except 9 color luminance combinations are available. The data in each half byte chooses one of the 9 color registers for J}the assigned pixel.Mode 11 (PRIOR = $C0 - FF (192 - 255), is the same as mode 9 except there is one brightness but 16 colorsJ}. The pixel data chooses one of the 16 available colors. The luminance is that of the background (COLBK).USING THE SCREEN HJ}ANDLER, OPENING A CHANNEL TO THE SCREEN HANDLERWhen a channel is opened to the screen handler the following actions take plJ}ace:The area of memory to be used for the screen data is cleared.A display list (program for the ANTIC chip) is set up for J}the proper graphics mode.The top-of-free-memory pointer, MEMTOP [$02E5,2 (741)], is set to point to the last free byte beforJ}e the display list.Before opening a channel to the screen handler, the pointer to the highest memory address needed by the pJ}rogram, APPMHI [$000E,2 (14)], should be properly set. This will prevent the screen handler from erasing part of the program J}when it sets-up the screen data region.When the channel is opened, two special options can be sent with the direction parameJ}ter (ICAX1).ICAX1 for screen open 7 6 5 4 3 2 1 0 ----------------- | C S W R | -J}---------------- 1 6 3 1 8 4 2 1 2 4 2 6 8 C 1 = don't clear the screen S 1 = split screJ}en R 1 = input W 1 = outputBefore the open command, the graphics mode number is placed into ICAX2.ICAX2 for screen oJ}pen 7 6 5 4 3 2 1 0 ----------------- | : mode | ----------------- mode = $00 tJ}hrough $0B (0 - 11 (0 - 15 on XL/XE))To open a channel to the screen in BASIC use the GRAPHICS command.----- mode = $00 tHi008053CHAPTER 8.2. BASIC screen open format GRAPHICS modeFor Example:- GRAPHICS 8This will set up a mode 8 graphiN}cs screen and open channel 6 to it. If the graphics mode is 1 - 8, a split screen will be set up. For example, GRAPHICS 8 wilN}l set up a mode 8 screen with a four line text window at the bottom. If 16 is added to the mode number, a full screen will beN} set-up. For example, GRAPHICS 8+16 or GRAPHICS 24 will set up a mode 8 screen, with no text window, a full 192 pixels high. N}If the number 32 is added to the mode number, the screen will not clear when the channel opens. If you want to use a channel N}other than #6, you will have to use the open command. It is used in the following format.screen open without GRAPHICS commanN}d OPEN #channel,direction/special,mode,S:For example:- OPEN #1,8,7,S:This will open channel 1 to a mode 7 screen for outpN}ut only. For use of special parameters, see ICAX1 above.USING AN OPEN CHANNEL TO THE SCREENOnce a channel is opened to the N}screen it is used like any other input or output device. In other words, data is placed on the screen by the PRINT and PUT coN}mmands. Data is retrieved from the screen with the INPUT and GET commands. The part of the screen which the data will be put N}in or taken from is determined by the X,Y coordinates in the database variables COLCRS [$0055,2 (85)] and ROWCRS [$0054 (84)]N}. What appears on the screen depends on what graphics mode the computer is in. Before sending data to the screen in BASIC, a N}color register must be assigned to the data. Once a point is plotted on the screen, it's color will be determined by the coloN}r register it was assigned to. To assign a color to a plotted point, the COLOR command us used as follows.COLOR command formN}at COLOR register. For example:- COLOR 1After using the above command, all points plotted will be controlled by color registN}er 1. To change color registers, use the COLOR command again. In assembly language, the color is determined by the data sent N}to the screen. See the above section on graphics modes for color information. In BASIC the PLOT command is used to put data oN}n the screen. The PLOT command is used as follows.The BASIC PLOT command:- PLOT x,yx and y are the horizontal and verticalN} coordinates for the plotted point. In modes 3 through 11 a single point will be plotted. In modes 1 and 2 a text character wN}ill be printed on the screen by the PLOT command.The PRINT and PUT commands can also be used in basic. What appears on the sN}creen depends on the graphics mode. In modes 1 and 2 the ATASCII characters sent to the screen will be printed just as in modN}e 0. See the paragraph on modes 1 and 2 above for more information. In the other modes what appears depends on how the ANTIC N}chip interprets the data bytes sent to the screen. For example, in mode 8, even numbered characters will be single pixels in N}color 1. Odd numbered characters will be in color 0 (background).There are two special commands for the screen handler, DRAWN} and FILLDRAW (ICCOM = $11 (17))The draw command works exactly like the plot command except a straight line is drawn from tN}he previous pixel to the new one. In BASIC it is used in the following format.The BASIC DRAW command DRAWTO x,y FILL (ICCON}M = $12 (18))Fill works like draw except the area to the right of the drawn line will be filled with the color in FILDAT [$0N}2FD (765)]. The fill command expects to find a boundary to the right. If no boundary is found, the entire horizontal screen bN}etween the ends of the line is filled. To use the fill command in BASIC the XIO command must be used in the following format.N} POSITION x,y XIO 18 #6,0,0,"E:"Note that the cursor is first moved by the POSITION command. Below is an example of how toN} prepare for and use the fill command.Using the fill command 2nd DRAWTO .____. DRAWTO here | | N} | | | | fill to here ! ! PLOT hereThis will draw and fill a box on the screen.THE COLON}R REGISTERSThere are nine bytes of memory which control the colors on the screen. These bytes are called color registers. ThN}e color registers have the following names and relationships.colors on the screen. These bytes are called color registers. ThL=008063Color registers and relationshipsRegister Register modesname address R} 0 & 8 1 & 2 3 5 7 4 & 6 9 & 11 10 HEX decimal COLOR numbersPCOLR0 $02C0 704 R} 0PCOLR1 $02C1 705 1PCOLR2 $R}02C2 706 2PCOLR3 $02C3 707 R} 3COLOR0 $02C4 708 0 - 63 1 1 4COLOR1 $02C5 709 1 - 255 64R} -127 2 5COLOR2 $02C6 710 0 128-191 3 6COLOR3 $02C7 R} 711 192-255 7COLOR4 $02C8 712 border backgnd 0 backgnd backR}gnd 8The color numbers are in decimal. These are actually shadow registers. See the O.S. equates below for relationshipR}s. In modes 0 - 3 the COLOR number actually determines the character printedThe register to which a pixel/character is assigR}ned to is determined by the data byte sent to the screen through CIO.The data in the color registers in in the following forR}mat.Color register data format 7 6 5 4 3 2 1 0 ----------------- | color |bright | R}----------------- color = one of 16 possible colors bright = one of 8 possible brightnesses (even nR}umbers, 0 - E)In basic, the COLOR command is used to assign color registers. The corresponding registers depends on the grapR}hics mode. For example, COLOR 0 is COLOR2 in mode 8. In most other modes COLOR 0 is COLOR4. See the above chart for the regisR}ter relationships.To change the contents of the color registers in BASIC, the SETCOLOR command is used. In all modes except R}mode 10, the SETCOLOR command refers to the registers COLOR0 to COLOR4.SETCOLOR/register relationships SETCOLOR 0 R}COLPF0 (COLOR0) SETCOLOR 1 COLPF1 (COLOR1) SETCOLOR 2 COLPF2 (COLOR2) SETCOLOR 3 COLPF3 (R}COLOR3) SETCOLOR 4 COLBK (COLOR4)The format for the SETCOLOR command is... SETCOLOR command format SETCOLOR rR}egister,hue,brightness register = 0 - 4 (0 - 8 in mode 10) hue = 0 - 15 (16 colors) brightness = 0 - 16 (even numR}bers only (8 brightnesses)The following chart gives the colors represented by the hue number.Colors represented by hue numbR}ers0 grey 8 blue1 gold 9 cyan2 gold-orange 10 blue-green3 red-orange 11 R} blue-green4 orange 12 green5 magenta 13 yellow-green6 purple-blue 14 yellow7 blue R} 15 yellow-redThe attract modeIf a key is not pressed for more than 9 minutes the computer will enter the attractR} mode. This mode is used to prevent burning of the TV phosphors by lowering the brightness and constantly changing the colorsR}. The attract mode timer, ATRACT [$004D (77)], is set to 254 ($FE) when the the attract mode is entered. To force the computeS}r out of the attract mode, poke a number less than 127 into ATRACT.Useful database variables and OS equatesAPPMHI $000E,2 S} (14): lower limit for screen regionATRACT $004D (77): attract mode timer and flagLMARGN $0052 (82): left S}marginRMARGN $0053 (83): right marginROWCRS $0054 (84): horizontal cursor positionCOLCRS $0055,2 (85): S}vertical cursor positionDINDEX $0057 (87): current graphics modeSAVMSC $0058,2 (88): starting address of displaS}y bufferOLDROW $005A (90): previous cursor positionOLDCOL $005B,2 (91): " " "OLDCHR $005D S} (93): character currently at the text cursorOLDADR $005E,2 (94): memory address of cursorRAMTOP $006A (106): S}end-of-RAM + 1 (MSB only)SDLSTL $0230,2 (560): shadow register of display list addressTXTROW $0290 (656): text wS}indow cursor positionTXTCOL $0291,2 (657): " " " "TXTMSC $0294,2 (660): starting address of text winS}dow data bufferRAMSIZ $02E4 (740): permanent end-of-RAM + (MSB only)CRSINH $02F0 (752): cursor inhibit, 1 = no S }cursorFILDAT $02FD (765): color data for fillDSPFLG $02FE (766): if >0 screen control codes are displayed as AS }TASCII characters (EOL is uneffected)SSFLAG $02FF (767): > 0 = stop screen printCOLPM0 $D012 (53266): actual coloS }r registersCOLPM1 $D013 (53267): loaded from shadowCOLPM2 $D014 (53268): registers duringCOLPM3 $D015 (53269):S } vertical blankCOLPF0 $D016 (53270):COLPF1 $D017 (53271): see aboveCOLPF2 $D018 (53272): for useCOLPF3 $D019 S } (53273):COLBK $D020 (53274):OS shadow registersPCOLR0 $02C0 (704): COLPM0PCOLR1 $02C1 (705): COLPMS}1PCOLR2 $02C2 (706): COLPM2PCOLR3 $02C3 (707): COLPM3COLOR0 $02C4 (708): COLPF0COLOR1 $02C5 (709)S}: COLPF1COLOR2 $02C6 (710): COLPF2COLOR3 $02C7 (711): COLPF3COLOR4 $02C8 (712): COLBK1 $02C5 (709)Pj008063CHAPTER 9. THE RESIDENT DISK HANDLERThe resident disk handler is separate from DOS and is part of the permaW}nent operating system ROM. The disk handler does not use CIO. The resident disk handler works with one sector at a time. It iW}s used by setting the drive number, sector number, and operation code in the device control block. The program then jumps (JSW}R) to the handler entry vector, DSKINV [$E453 (58451)]. Device control block (for resident disk handler)DDEVIC [$0300 (768)]W} Serial bus I.D. Set by handlerDUNIT [$0301 (769)] Drive numberDCOMND [$0302 (770)] Command byteDSTATS [$0303 (771)] W} status byteDBUFLO [$0304 (772)]DBUFHI [$0305 (773)]Pointer to 128 byte memory block for data storage.DTIMLO [$0306 (774)W}] Timeout value (response time limit) in secondsDBYTLO [$0308 (776)]DBYTHI [$0309 (777)] number of bytes transferred, setW} by handlerDAUX1 [$030A (778)]DAUX2 [$030B (779)] sector numberDISK HANDLER COMMANDSGET SECTORBefore the JSR to DSKIW}NV is made the following parameters are set.GET SECTOR parameters DCOMND = $52 (82) DUNIT = (1 - 4) DBUFHI W} and DBUFLO = address of 128 byte buffer DAUX1 and DAUX2 = Sector number (LSB,MSB)This operation will reaW}d the specified sector and put the data into the specified buffer.PUT SECTORPUT SECTOR is used the same as GET SECTOR exceW}pt for DCOMND.PUT SECTOR parameters DCOMND = $50 (80)This operation sends the data in the specified buffer to the specW}ified disk sector.PUT SECTOR WITH VERIFYPUT SECTOR WITH VERIFY is used the same as PUT SECTOR except for DCOMND.PUT SECTOW}R WITH VERIFY parameters DCOMND = $57 (87)This operation sends the data in the specified buffer to the specified disk sW}ector then checks for errors.GET STATUSOnly the DUNIT and DCOMND need to be setGET STATUS parameters DCOMND = $53 (8W}3) DUNIT = (1 - 4)The status information will be put in three bytes starting at DVSTAT [$02EA (746)]. Status format:-W } 7 6 5 4 3 2 1 0 ----------------- DVSTAT + 0 | command stat | W!} ----------------- + 1 | hardware stat | ----------------- + 2 W"}| timeout value | -----------------The command status byte gives the following information. Bit W#} 0 1 = invalid command frame received 1 1 = invalid data frame received 2 1 = unsuccessful PUT operation W$} 3 1 = disk is write protected 4 1 = active/standbyThe hardware status byte contains the status register of thW%}e ISN1771-1 disk controller chip. The timeout byte contains the maximum allowable response time for the drive in seconds.FOW&}RMAT DISKThe handler will format then verify the the disk. The numbers of all bad sectors (up to 63) will be put into the spW'}ecified buffer followed by two bytes of $FF. The following parameters are set before the call.FORMAT parameters DCOMND W(}= $21 (33) DUNIT = (1 - 4) DBUFLO and DBUFHI = address of bad sector list (buffer)After the operation the W)}status byte is set. Also, DBYTLO and DBYTHI will contain the number of bytes of bad sector information (not including the twoW*} $FF bytes).Useful data base variables and OS equatesDVSTAT $02EA,3 (746): device status block, 3 bytesDDEVIC $0300 W+} (768): serial bus I.D.DUNIT $0301 (769): device numberDCOMND $0302 (770): command byteDSTATS $0303 W,} (771): status byteDBUFLO $0304 (772): data bufferDBUFHI $0305 (773): pointerDTIMLO $0306 (774):W-} timeout valueDBYTLO $0308 (776): number of bytes transferedDBYTHI $0309 (777):DAUX1 $030A (778): seW.}ctorDAUX2 $030B (779): numberDSKINV $E453 (58451): disk handler entry vector7):DAUX1 $030A (778): seT\008063CHAPTER 10. SYSTEM INTERRUPTSThere are four types of interrupts which can occur with the 6502 microprocesso[0}r:6502 interrupts 1. chip reset 2. IRQ, interrupt request (maskable) 3. MNI (non-maskable interrupt) [1} 4. software interrupt (BRK instruction)CHIP RESETOn the 400/800 the chip reset occurs only upon power-up and causes t[2}he computer to do a cold start. On later models, pressing [SYSTEM RESET] will cause a chip reset but the computer then does [3}a warm start. On the 400/800, the [SYSTEM RESET] key generates a NMI interrupt.COLD STARTThis is a synopsis of the cold s[4}tart routine. The warm start flag [$0008] is set to 0 (false). If a cartridge slot contains a diagnostic cartridge, control i[5}s handed to the cartridge.The end of RAM is determined by trying to complement the first byte of each 4K block of memory. Ha[6}rdware registers at $D000 - $D4FF (except $D100 - $D1FF) are cleared. RAM is cleared from $0008 to the top of ram. The user p[7}rogram jump vector, DOSVEC [$000A] is set to point to the black board mode (Atari logo display mode in XL/XE models). The scr[8}een margins are set to 2 and 39. Interrupt vectors are initialized. Bottom of free RAM pointer, MEMLO [$02E7], is set to poin[9}t to $0700. Resident CIO handlers are initialized. If the [START] key is pressed the cassette boot request flag, CKEY [$004A][:}, is set. The CIO device table is initialized. If a cartridge is present it is initialized. Channel 0 is opened to the screen[;} editor. The top-of-free-RAM pointer, MEMTOP [$02E5], is set to point below the screen region. The computer then waits for th[<}e screen to be established before continuing. If the cassette boot flag is set the cassette is booted. If there is no cartrid[=}ge present or a cartridge doesn't prevent it, the disk is booted. The cold start flag is reset. If there is a cartridge prese[>}nt, the computer jumps to the cartridge's run vector. If there is no cartridge present the computer jumps through the vector [?}DOSVEC [$000A (10)]. DOSVEC will point to either a booted program, the memo pad routine (400/800) or the logo display routine[@} (XL/XE).WARM STARTThe warm start flag is set to $7F (true). Cold start steps 2 - 4 are executed. RAM is cleared from $001[A}0 - $007F and $0200 - $03FF. Cold start steps 7 - 14 are executed. If cassette booted software is present the computer JSRs t[B}hrough CASINI [$0002]. If disk booted software is present the computer JSRs through DOSINI [$000C (12)].The difference betwe[C}en cold start and warm start is the condition of the warm start flag, WARMST, [$0008]. If this flag is 0 a complete cold star[D}t is executed. If the flag is anything other than 0 then only the warm start part of the warm start/cold start code is execut[E}ed.NON-MASKABLE INTERRUPTS (NMI)NMI interrupts are generated by the following conditions:1. Display list interrupt, gen[F}erated by the ANTIC chip.2. TV vertical blank interrupt, generated by the ANTIC chip.3. [SYSTEM RESET] key (400/800).W[G}hen an NMI interrupt occurs, the hardware register NMIST [$D40F] is examined to determine what type of interrupt occurred. Th[H}e computer is then directed through the proper ram vector to service the interrupt.DISPLAY LIST INTERRUPTS (DLIs)The compu[I}ter makes no use of DLIs. The ram vector points to an RTI instruction.VERTICAL BLANK INTERRUPTS (VBIs)There are two stages[J} to the VBI service routine. The second stage is only done if a critical function was not interrupted.Stage 1 (VBI)The re[K}al time clock, RTCLOK [$0012 - $0014], is incremented. The attract mode variables are processed. System timer 1 is decremente[L}d. If it goes to zero the computer JSRs through system time-out vector 1.Stage 2 (VBI)The hardware registers are loaded wi[M}th the data in their shadow registers. System timer 2 is decremented. If it goes to zero the computer JSRs through the system[N} time-out vector 2. System timers 3, 4, and 5 are decremented. If a timer goes to zero the computer sets system timer flags 3[O}, 4, and/or 5. If auto-repeat is active, the auto-repeat process is done. The keyboard debounce timer is decremented if not 0[P}. Information at the controller port registers is read, processed and placed in the proper shadow registers.[SYSTEM RESET] [Q}INTERRUPTIf a [SYSTEM RESET] interrupt is generated on the 400/800 the computer jumps to the warm start routine.STEM RESET] Xq008063CHAPTER 10.1. INTERRUPT REQUESTS (maskable interrupts (IRQs))When an IRQ interrupt occurs the hardware regi_S}ster IRQST [$D20E], the PIA status registers, PACTL [$D302] and PBCTL [$D303] are examined to determine what caused the inter_T}rupt. For each interrupt, the 6502 accumulator is pushed to the stack. The computer is then directed to the proper ram vector_U} to service the interrupt.SOFTWARE INTERRUPT (BRK instruction)The operating system doesn't use software interrupts. The so_V}ftware interrupt vector points to a PLA followed by an RTI.Interrupt vectorsLabel address type functionVDSLST $0200 NMI_W} DLI Points to an RTIVVBLKI $0222 NMI stage 1 VBIVVBLKD $0224 NMI return-from-interrupt routineCDTMA1 $0226 NMI _X}time-out 1 (used by SIO)CDTMA2 $0228 NMI time-out 2 (not used by OS)VPRCED $0202 IRQ not used (points to PLA,RTI)VIN_Y}TER $0204 IRQ not used (PLA,RTI)VKEYBD $0208 IRQ keyboard interruptVSERIN $020A IRQ used by Serial I/O routineVSE_Z}ROR $020C IRQ used by SIOVSEROC $020E IRQ used by SIOVTIMR1 $0210 IRQ not used by OS (PLA,RTI)VTIMR2 $0212 IRQ _[} not used by OS (PLA,RTI)VTIMR4 $0214 IRQ ?VIMIRQ $0216 IRQ main IRQ codeVBREAK $0206 BRK unused by OS (PLA,RTI)_\} 10SYSTEM TIMERSThe following timers are updated during vertical blank (VBI) as noted above. If a timer is decremented to_]} 0 the computer jumps through it's associated vector or sets it's associated flag.Label address flag/vectorRTCLOK $0012 _^} 3 byte clock ($0012 = MSB)CDTMV1 $0218 CDTMA1 $0226 vector (SIO time-out)CDTMV2 $021A CDTMA2 $0228 vectorCDTMV3 __}$021C CDTMF3 $022A flagCDTMV4 $021E CDTMF4 $022C flagCDTMV5 $0220 CDTMF5 $022E flagHARDWARE INTERRUPT CONTROL_`}There are two registers on the antic chip which control interrupts. These registers can be used to disable interrupts if nec_a}essary. There are also two associated interrupt status registers. The IRQ enable and status registers use the same address. T_b}he result is that reading the register does not reveal the enabled interrupts but the interrupts pending. IRQ interrupt enabl_c}e data should usually be written to the OS shadow first. Reading the OS shadow tells which interrupts are enabled.Non maska_d}ble interrupt enableNMIEN $D40E 7 6 5 4 3 2 1 0 ----------------- | | | not used | _e} ----------------- bit 7 1 = DLI enabled 6 1 = VBI enabledNon maskable interrupt statusNMIST $D40F 7 _f}6 5 4 3 2 1 0 ----------------- | | | | not used| ----------------- bit 7 1 = DLI pending _g} 6 1 = VBI pending 5 1 = [SYSTEM RESET] key pendingInterrupt request enableIRQEN $D20E 7 6 5 4 3 2 1 0_h} ----------------- | | | | | | | | | ----------------- bit 7 1 = [BREAK] key interrupt enabl_i}e 6 1 = keyboard interrupt enable 5 1 = serial input interrupt enable 4 1 = serial output interrupt enable_j} 3 1 = serial output-finished interrupt enable 2 1 = timer 4 interrupt enable 1 1 = timer 2 interrupt enable_k} 0 1 = timer 1 interrupt enable IRQEN has a shadow register, POKMSK [$0010 (A)].Interrupt request statusIRQST $D20_l}E 7 6 5 4 3 2 1 0 ----------------- | | | | | | | | | ----------------- bit 7 1 =_m} [BREAK] key interrupt pending 6 1 = keyboard interrupt pending 5 1 = serial input interrupt pending 4 1 = _n}serial output interrupt pending 3 1 = serial output-finished interrupt pending 2 1 = timer 4 interrupt pending _o} 1 1 = timer 2 interrupt pending 0 1 = timer 1 interrupt pendingWAIT FOR HORIZONTAL SYNCWriting any number to WSY_p}NC [$D40A (54282)] will cause the computer to stop and wait for the next TV horizontal sync. It is wise to use DLIs one TV li_q}ne before needed then writing to WSYNC. This will keep other interrupts from causing DLIs to be serviced late. This can cause_r} a DLI to change something in the middle of a scan line.Useful database variables and OS equatesPOKMSK $0010 (16): IR_s}QEN shadowIRQEN $D20E (53774): enables IRQs when written toIRQST $D20E (53774); gives IRQs waiting when readPACTL _t} $D302 (54018): bit 7 (read) peripheral A interrupt status bit 0 (write) peripheral A interrupt enablePBCTL $D303 (54_u}019): bit 7 (read) peripheral B interrupt status bit 0 (write) peripheral B interrupt enableWSYNC $D40A (54282): wait fo_v}r horizontal syncNMIEN $D40E (54286): NMI enableNMIST $D40F (54287): NMI statusbleWSYNC $D40A (54282): wait fo\Y008063CHAPTER 11. THE FLOATING POINT ARITHMETIC PACKAGEThe routines which do floating point arithmetic are a partcx} of the operating system ROM. The Atari computer uses the 6502's decimal math mode. This mode uses numbers represented in paccy}ked Binary Coded Decimal (BCD). This means that each byte of a floating point number holds two decimal digits. The actual metcz}hod of representing a full number is complicated and probably not very important to a programmer. However, for those with thec{} knowledge to use it, the format is given below.Floating point number representation byte 0 xx excess 64 expoc|}nent + sign xx \ xx \ xx > 10 BCD digits xc}}x / byte 7 xx /The decimal point is shifted to left of the MSD and the exponent is adjusted accordingly. Therec~}fore, the decimal point doesn't need to be represented. For programming purposes, floating point numbers can be in ASCII codec}. It takes up to 14 bytes to store a floating point number in this manner. The floating point package has a routine to converc}t numbers between ASCII and floating point.USE OF THE FLOATING POINT PACKAGEThe floating point package has several routinec}s to convert between ASCII and FP and to do the arithmetic functions. These are the important data base variables.Floating c}point data base variablesFR0 $00D4,6 (212): 6 byte buffer for floating point numberFR1 $00E0,6 (224): 6 byte buc}ffer for floating point numberCIX $00F2 (242): index for INBUFF addressINBUFF $00F3,2 (243): 2 byte pointer to Ac}SCII floating point numberFLPTR $00FC,2 (252): 2 byte pointer to user buffer for floating point numberLBUFF $0580,? c}(1408): result buffer for FASC routineMAKING THE CALLTo do a floating point function, first set the proper pointers and JSc}R to the operation entry point. Below is a list of the entry points and parameters.ASCII to floating pointConverts ASCII rc}epresentation pointed to by INBUFF to FP in FR0. AFP = $D800 INBUFF = address of ASCII number CIX = buffer offset ifc} any JSR AFPFLOATING POINT TO ASCIIConverts floating Point number in FR0 to ASCII. The result will be in LBUFF. INBUFF c}will point to the ASCII number which will have the bit 7 of the last byte set to 1. FASC = $D8E6 JSR FASCINTEGER TO FLOc}ATING POINT CONVERSION.Converts a 2 byte unsigned integer (0 to 65535) in FR0 to floating point in FR0. IFP = $D9AA JSRc} IFPFLOATING POINT TO INTEGER CONVERSION.Converts floating point number in FR0 to 2 byte integer in FR0. FPI = $D9D2c} JSR FPI BCS overflowADDITIONAdds floating point numbers in FR0 and FR1 with result in FR0. FADD = $DA66 JSR FADD Bc}CS out of rangeSUBTRACTION subtracts FR1 from FR0 with the result in FR0. FSUB = $DA60 JSR FSUB BCS out of rangeMUc}LTIPLICATIONMultiplies FR0 by FR1 with the result in FR0. FMUL = $DADB JSR FMUL BCS out of rangeDIVISIONDivides FR0c} by FR1 with result in FR0. FDIV = $DB28 JSR FDIV BCS out of range or divisor is 0LOGARITHMSPuts logarithm of FR0 inc} FR0 LOG = $DECD LOG10 = $DED1 JSR LOG ;for natural log. or JSR LOG10 ;for base 10 log. BCS negative number or ovec}rflowEXPONENTIATIONPut exponentiation of FR0 in FR0 EXP = $DDC0 EXP10 = $DDCC JSR EXP ;for e ** Z or JSR EXP10 ;c}for 10 ** ZPOLYNOMIAL EVALUATIONPuts the result of an n degree polynomial evaluation of FR0 in FR0. PLYEVL = $DD40 LDXc} LSB of pointer to list of floating point coefficients, ordered high to low. LDY MSB of above LDA number of coefficients inc} list JSR PLYEVL BCS overflowCLEAR FR0Sets FR0 to all zeroes ZFR0 = $DA44 JSR ZFR0CLEAR ZERO PAGE FLOATING POINT c}NUMBERClears user floating point number in page zero. ZF1 = $DA46 LDX address of zero page FP buffer JSR ZF1LOAD FRc}0 WITH FLOATING POINT NUMBERLoads FR0 with user FP number in buffer pointed to by 6502 X and Y registers or by FLPTR. After c}either operation below, FLPTR will point to the user FP buffer. FLD0R = $DD89 LDX lsb of pointer LDY msb JSR FLD0R or c}FLD0P = $DD8D FLPTR = address of FP number JSR FLD0PLOAD FR1 WITH FLOATING POINT NUMBERLoads FR1 with user FP numberc} in buffer pointed to by 6502 X and Y registers or by FLPTR. After either operation below, FLPTR will point to the user FP buc}ffer. FLD1R = $DD98 LDX lsb of pointer LDY msb JSR FLD1R or FLD1P = $DD9C FLPTR = address of FP number JSR FLD1Pc}STORE FR0 IN USER BUFFERstores the contents of FR0 in user FP buffer pointed to by 6502 X and Y registers or by FLPTR. Aftc}er either operation below, FLPTR will point to the user FP buffer. FST0R = $DDA7 LDX lsb of pointer LDY msb JSR FST0R c}or FST0P = $DDAB FLPTR = address of FP number JSR FST0PMOVE FR0 TO FR1Moves the contents of FR0 to FR1 FMOVE = $c}DDB6 JSR FMOVEThe usual use sequence of the floating point package might be to:load FR0 and FR1 with FP numbers from user c}specified buffersdo the math then store FR0 in a user buffer. An alternative might be to: convert an ASCII representatic}on to FP (the result is automatically in FR0). move FR0 to FR1. Convert the second ASCII number. Do the math. Convert FR0 bacc}k to ASCII. Store the number back into a user buffer. The floating point package uses the following blocks of RAM.RAM used c}by floating point package $00D4 - $00FF $057E - $05FFIf the floating point package is not used the above ram is frc}ee.Useful data base variables and OS equatesFR0 $00D4,6 (212): system FP bufferFR1 $00E0,6 (224): system Fc}P bufferCIX $00F2 (242): INBUFF indexINBUFF $00F3,2 (243): pointer to ASCII FP bufferFLPTR $00FC,2 (2c}52): pointer to user FP bufferLBUFF $0580 (1408): result buffer for FP to ASCIIAFP $D800 (55296): ASCII to Fc}PFASC $D8E6 (55526): FP to ASCIIIFP $D9AA (55722): integer to FPFPI $D9D2 (55762): FP to integerZFc}R0 $DA44 (55876): clear FR0ZF1 $DA46 (55878): clear zero page FP bufferFSUB $DA60 (55904): FR0 - FR1c}FADD $DA66 (55910): FR0 + FR1FMUL $DADB (56027): FR0 * FR1FDIV $DB28 (56104): FR0 / FR1FLD0R $DD89 c} (56713): load FR0 by X,Y pointerFLD0P $DD8D (56717): load FR0 by FLPTR pointerFLD1R $DD98 (56728): load FR1c} by X,Y pointerFLD1P $DD9C (56732): load FR1 by FLPTR pointerFST0R $DDA7 (56743): store FR0 at buffer by X,Y poc}interFST1P $DDAB (56747): store FR0 at buffer by FLPTR pointerFMOVE $DDB6 (56758): move FR0 to FR1EXP $DDC0c} (56768): e exponentiationEXP10 $DDCC (56780): base 10 exponentiationPLYEVL $DD40 (56640): polynomial evaluc}ationLOG $DECD (57037): natural log of FR0LOG10 $DED1 (57041): base 10 log of FR0 (56640): polynomial evalu`a008063CHAPTER 12. Boot software formatsThere are three ways which programs may be booted (loaded automatically upg}on power-up): From the disk drive: From the cassette recorder: From a ROM cartridgeDISK BOOTED SOFTWAREThe disk drive is tg}he primary source for programs (other than the BASIC interpreter in the computer ROM). A program booted from disk must be a mg}achine language program. Secondly, the program is arranged on disk in a different manner from the DOS files. When the computeg}r is first turned on, it will attempt to read a program starting at sector one in disk drive one. The exceptions are, if a cag}rtridge prevents the disk boot process or the [START] key is pressed. The program is expected to use all 128 bytes of each seg}ctor.FORMAT OF A DISK BOOTED PROGRAMA disk booted program begins at sector one on the disk and continues in sequence. The g}first six bytes of the first sector contain program information. The rest of the bytes contain the program itself.Disk boot g}program header 1st byte $00 flags, stored in DFLAGS [$0240] $xx number of sectors used by program $xx address to start loag}ds $xx. $xx initialization address 6th byte $xx 7th byte $xx start of program.The flags byte is usually unused g}and should be zero.The load address is stored in BOOTAD [$0242,2 (578)].The initialization address is stored in DOSINI [$00g}0C,2 (12)].After the program is completely loaded the computer will JSR to the address stored in DOSINI for initialization. g}It will then jump to the address stored in DOSVEC to run the program. The initialization part of the program should set the bg}ottom-of-free-RAM pointer, MEMLO [$02E7,2 (743)], to point to the end of the program + 1. This will protect the program from g}the computer and other programs. The top-of-user-RAM pointer, APPMHI [$000E,2 (14)], is also usually set to point to the sameg} address. This will protect the program from the video hardware. It must also set DOSVEC [$000A,2 (10)] to actually point to g}the run address of the program. The initialization should of course end with and RTS. With DOSINI and DOSVEC properly set, thg}e program will restart up pressing the [SYSTEM RESET] key. Remember that the load address of the program should be six bytes g}before where you want the program to reside in memory. The six byte header will load at the specified start address followed g}by the program.CASSETTE BOOTED SOFTWAREThe cassette boot process is nearly identical to the disk boot process. The processg}es are so similar that cassette boot programs can usually be transferred directly to disk and vice-versa. The two differencesg} are:The cassette is booted instead of the disk if the [START] key is pressed when the power is turned on. A bug in early opg}erating systems requires the booted program to turn off the cassette motor with the following command. LDA #$3C STA Pg}ACTL [$D302]CARTRIDGE BOOTED SOFTWAREThe Atari 800 has two cartridge slots. All other models have only one. The second cartg}ridge slot, slot B on the 800, resides from $8000 to $9FFF. The first slot, slot A, resides from $A000 to BFFF. If a cartridgg}e is inserted in a slot it will disable any RAM in the same area. Slot A, which is present in all models, can reside at the eg}ntire 16K used by both cartridges in the 800 ($8000 to $BFFF). Cartridges use the last six bytes for boot information. In carg}tridge A these bytes are from $BFFA to $BFFF. In cartridge B they are from $9FFA to 9FFF. Last six bytes of a cartridge $9g}FFA or $BFFA xx start address xx 00 xx flag byte g} xx init address $9FFF or $BFFF xx Flag byte bit 0 1 = allow disk boot bit 2 0 = do not stg}art cartridge after init bit 7 1 = cartridge takes control before OS is initialized.The initialization process for g}the cartridge should be similar to that for disk and cassette. A minimum of an RTS instruction is required. The third byte ofg} the cartridge tailer is used by the OS to check for the presence of a cartridge. This byte must be zero. A 16K cartridge wilg}l use both cartridge areas and the cartridge B tailer area can be used for program code.THE CARTRIDGE HARDWAREMost cartridg}ges consist of two ROM chips on a single circuit board. Moreover, both chip sockets have identical pin assignments. In other g}words, the chips can be switched to opposite sockets and the cartridge will still work. The difference is in the chips themsg}elves. On one chip, the A12 pin acts as an active-low chip select. On the other the A12 pin acts as an active-high chip selecg}t. Therefore the state of the A12 pin selects between the two chips.Cartridge slot pin assignments BACK g} 111111 543210987654321 --------------- --------------- SRPNMLKg}JHFEDCBA FRONT 1 1 = 16K A A13 (16K only) 2 A3 B GND 3 A2 C g} A4 4 A1 D A5 5 A0 E A6 6 D4 F A7 7 D5 H A8 8 g} D8 J A9 __ 9 D1 K A12 (CS)/(CS) 10 D0 L D3 11 D6 __ M D7 1g}2 (CS) N A11 13 +Vcc P A10 14 +Vcc R NC 15 NC S NCThe BASIC interpg}reter resides in the memory used by cartridge A. In 400, 800 and 1200XL models, a BASIC cartridge is required to run BASIC prg}ograms. On other XL and XE models, inserting a cartridge into the slot or pressing the [OPTION] key upon power-up will disablg}e the internal BASIC ROM. If BASIC is disabled without inserting another cartridge, the area from $A000 to $BFFF will containg} RAM.Useful data base variables and OS equatesAPPMHI $000E,2 (14): low limit of screen regionDOSVEC $000A,2 (1g}0): run and program reset vectorDOSINI $000C,2 (12): init and reset initCARTB $8000 (32768): start of cartridgeg} BCARTA $A000 (40960): start of cartridge APACTL $D302 (54018): port A control register Bit 3 controls the cag}ssette motor000 (40960): start of cartridge APACTL $D302 (54018): port A control register Bit 3 controls the cad